mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
Cosmetics.
This commit is contained in:
parent
39c0820517
commit
c532ede4cd
3 changed files with 11 additions and 13 deletions
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue