1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 09:55:29 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-05-19 10:53:56 -07:00
parent 39c0820517
commit c532ede4cd
3 changed files with 11 additions and 13 deletions

View file

@ -7656,7 +7656,7 @@ public class AST2TemplateTests extends AST2TestBase {
}
// template<typename T>
// class ATemplate {
// class A {
// int defaultMemberVariable;
// public:
// int publicMemberVariable;
@ -7665,10 +7665,10 @@ public class AST2TemplateTests extends AST2TestBase {
// private:
// int privateMemberVariable;
// };
public void testTemplateMemberAccessibilities() throws Exception {
public void testTemplateMemberAccessibility() throws Exception {
BindingAssertionHelper bh = getAssertionHelper();
ICPPClassTemplate aTemplate = bh.assertNonProblem("ATemplate");
ICPPClassTemplate aTemplate = bh.assertNonProblem("A");
ICPPField defaultMemberVariable = bh.assertNonProblem("defaultMemberVariable");
assertVisibility(ICPPClassType.v_private, aTemplate.getVisibility(defaultMemberVariable));
@ -7684,12 +7684,10 @@ public class AST2TemplateTests extends AST2TestBase {
}
// template<typename T>
// class ATemplate {};
//
// class A{};
// class A {};
//
// template<>
// class ATemplate<A> {
// class A<int> {
// int specializedDefaultVariable;
// public:
// int specializedPublicVariable;
@ -7698,10 +7696,10 @@ public class AST2TemplateTests extends AST2TestBase {
// private:
// int specializedPrivateVariable;
// };
public void testTemplateSpecializationMemberAccessibilities() throws Exception {
public void testTemplateSpecializationMemberAccessibility() throws Exception {
BindingAssertionHelper bh = getAssertionHelper();
ICPPClassSpecialization aTemplateSpecialization = bh.assertNonProblem("ATemplate<A>");
ICPPClassSpecialization aTemplateSpecialization = bh.assertNonProblem("A<int>");
ICPPField defaultMemberVariable = bh.assertNonProblem("specializedDefaultVariable");
assertVisibility(ICPPClassType.v_private, aTemplateSpecialization.getVisibility(defaultMemberVariable));

View file

@ -98,7 +98,7 @@ public class CPPClassInstance extends CPPClassSpecialization implements ICPPTemp
public static boolean isSameClassInstance(ICPPClassSpecialization classInstance, IType type) {
assert classInstance instanceof ICPPTemplateInstance;
// require a class instance
// Require a class instance.
if (!(type instanceof ICPPClassSpecialization) || !(type instanceof ICPPTemplateInstance) ||
type instanceof IProblemBinding) {
return false;

View file

@ -414,7 +414,7 @@ public class CPPClassSpecialization extends CPPSpecialization
}
public static boolean isSameClassSpecialization(ICPPClassSpecialization t1, ICPPClassSpecialization t2) {
// exclude class template specialization or class instance
// Exclude class template specialization or class instance.
if (t2 instanceof ICPPTemplateInstance || t2 instanceof ICPPTemplateDefinition ||
t2 instanceof IProblemBinding) {
return false;
@ -426,13 +426,13 @@ public class CPPClassSpecialization extends CPPSpecialization
if (!CharArrayUtils.equals(t1.getNameCharArray(), t2.getNameCharArray()))
return false;
// the argument map is not significant for comparing specializations, the map is
// The argument map is not significant for comparing specializations, the map is
// determined by the owner of the specialization. This is different for instances,
// which have a separate implementation for isSameType().
final IBinding owner1= t1.getOwner();
final IBinding owner2= t2.getOwner();
// for a specialization that is not an instance the owner has to be a class-type
// For a specialization that is not an instance the owner has to be a class-type.
if (!(owner1 instanceof ICPPClassType) || !(owner2 instanceof ICPPClassType))
return false;