1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-04-24 12:43:10 -07:00
parent c53ce7042b
commit d7e43b1a2c
6 changed files with 18 additions and 23 deletions

View file

@ -3753,13 +3753,13 @@ public class AST2TemplateTests extends AST2TestBase {
// } // }
public void testTypedefPreservation_380498_1() throws Exception { public void testTypedefPreservation_380498_1() throws Exception {
BindingAssertionHelper ba= getAssertionHelper(); BindingAssertionHelper ba= getAssertionHelper();
ICPPVariable s1 = ba.assertNonProblem("s1", ICPPVariable.class); ICPPVariable s1 = ba.assertNonProblem("s1");
assertTrue(s1.getType() instanceof ITypedef); assertTrue(s1.getType() instanceof ITypedef);
assertEquals("string", ((ITypedef) s1.getType()).getName()); assertEquals("string", ((ITypedef) s1.getType()).getName());
ICPPVariable s2 = ba.assertNonProblem("s2", ICPPVariable.class); ICPPVariable s2 = ba.assertNonProblem("s2");
assertTrue(s2.getType() instanceof ITypedef); assertTrue(s2.getType() instanceof ITypedef);
assertEquals("string", ((ITypedef) s2.getType()).getName()); assertEquals("string", ((ITypedef) s2.getType()).getName());
ICPPVariable s3 = ba.assertNonProblem("s3", ICPPVariable.class); ICPPVariable s3 = ba.assertNonProblem("s3");
assertTrue(s3.getType() instanceof ITypedef); assertTrue(s3.getType() instanceof ITypedef);
assertEquals("string", ((ITypedef) s3.getType()).getName()); assertEquals("string", ((ITypedef) s3.getType()).getName());
} }
@ -6267,7 +6267,7 @@ public class AST2TemplateTests extends AST2TestBase {
ICPPTemplateParameter aliasParameterT= templateParameterAlias.getTemplateParameters()[0]; ICPPTemplateParameter aliasParameterT= templateParameterAlias.getTemplateParameters()[0];
assertEquals(1, aliasParameterT.getTemplateNestingLevel()); assertEquals(1, aliasParameterT.getTemplateNestingLevel());
ICPPAliasTemplateInstance aliasIntInstance = bh.assertNonProblem("Alias<int>", ICPPAliasTemplateInstance.class); ICPPAliasTemplateInstance aliasIntInstance = bh.assertNonProblem("Alias<int>");
IType typeOfAliasIntInstance = aliasIntInstance.getType(); IType typeOfAliasIntInstance = aliasIntInstance.getType();
assertTrue(typeOfAliasIntInstance instanceof ICPPBasicType); assertTrue(typeOfAliasIntInstance instanceof ICPPBasicType);
assertEquals(((ICPPBasicType)typeOfAliasIntInstance).getKind(), IBasicType.Kind.eInt); assertEquals(((ICPPBasicType)typeOfAliasIntInstance).getKind(), IBasicType.Kind.eInt);
@ -7019,7 +7019,7 @@ public class AST2TemplateTests extends AST2TestBase {
// const bool B = has_type<int>::value; // const bool B = has_type<int>::value;
public void testSFINAEInNestedTypeInTemplateArgument_402257() throws Exception { public void testSFINAEInNestedTypeInTemplateArgument_402257() throws Exception {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true); BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
ICPPVariable B = helper.assertNonProblem("B", ICPPVariable.class); ICPPVariable B = helper.assertNonProblem("B");
Long val = B.getInitialValue().numericalValue(); Long val = B.getInitialValue().numericalValue();
assertNotNull(val); assertNotNull(val);
assertEquals(0 /* false */, val.longValue()); assertEquals(0 /* false */, val.longValue());
@ -7461,7 +7461,7 @@ public class AST2TemplateTests extends AST2TestBase {
// constexpr int bar = foo<int, double>::i; // constexpr int bar = foo<int, double>::i;
public void testSizeofParameterPackOnTypeid_401973() throws Exception { public void testSizeofParameterPackOnTypeid_401973() throws Exception {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true); BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
ICPPVariable bar = helper.assertNonProblem("bar", ICPPVariable.class); ICPPVariable bar = helper.assertNonProblem("bar");
Long barValue = bar.getInitialValue().numericalValue(); Long barValue = bar.getInitialValue().numericalValue();
assertNotNull(barValue); assertNotNull(barValue);
assertEquals(2, barValue.longValue()); assertEquals(2, barValue.longValue());
@ -7571,7 +7571,7 @@ public class AST2TemplateTests extends AST2TestBase {
// } // }
public void testUnqualifiedFunctionCallInTemplate_402498c() throws Exception { public void testUnqualifiedFunctionCallInTemplate_402498c() throws Exception {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true); BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
ICPPVariable x = helper.assertNonProblem("x", ICPPVariable.class); ICPPVariable x = helper.assertNonProblem("x");
// We really should assert that x's type is a ProblemType, but the semantic // We really should assert that x's type is a ProblemType, but the semantic
// analyzer is too lenient and makes it a TypeOfDependentExpression if it // analyzer is too lenient and makes it a TypeOfDependentExpression if it
// can't instantiate the return type of foo() properly. // can't instantiate the return type of foo() properly.

View file

@ -60,9 +60,9 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
public static final ASTNodeProperty NAME = new ASTNodeProperty( public static final ASTNodeProperty NAME = new ASTNodeProperty(
"ICPPASTBaseSpecifier.NAME - Name of base class"); //$NON-NLS-1$ "ICPPASTBaseSpecifier.NAME - Name of base class"); //$NON-NLS-1$
public static final int v_public = 1; public static final int v_public = ICPPASTVisibilityLabel.v_public;
public static final int v_protected = 2; public static final int v_protected = ICPPASTVisibilityLabel.v_protected;
public static final int v_private = 3; public static final int v_private = ICPPASTVisibilityLabel.v_private;
/** /**
* Returns whether this specifies a virtual base. * Returns whether this specifies a virtual base.
@ -108,17 +108,16 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
} }
/** /**
* Get the base specifiers. * Returns the base specifiers.
* *
* @return <code>ICPPASTBaseSpecifier []</code> * @return <code>ICPPASTBaseSpecifier []</code>
*/ */
public ICPPASTBaseSpecifier[] getBaseSpecifiers(); public ICPPASTBaseSpecifier[] getBaseSpecifiers();
/** /**
* Add a base specifier. * Adds a base specifier.
* *
* @param baseSpec * @param baseSpec <code>ICPPASTBaseSpecifier</code>
* <code>ICPPASTBaseSpecifier</code>
*/ */
public void addBaseSpecifier(ICPPASTBaseSpecifier baseSpec); public void addBaseSpecifier(ICPPASTBaseSpecifier baseSpec);

View file

@ -13,8 +13,7 @@ package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration; import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
/** /**
* C++ allows for visibility labels to be mixed interdeclaration in class * C++ allows for visibility labels to be mixed with declarations in class specifiers.
* specifiers.
* *
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.

View file

@ -87,9 +87,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
} }
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMember#getVisibility()
*/
@Override @Override
public int getVisibility() { public int getVisibility() {
IASTDeclaration decl = getPrimaryDeclaration(); IASTDeclaration decl = getPrimaryDeclaration();

View file

@ -16,8 +16,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBas
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
/** /**
* Enum that represents C++ visibilities, with methods to convert to * Enum that represents C++ visibilities, with methods to convert to and from ICPPASTVisiblityLabel.
* and from ICPPASTVisiblityLabel.
*/ */
public enum VisibilityEnum { public enum VisibilityEnum {
// The values are ordered by increasing visibility. // The values are ordered by increasing visibility.