diff --git a/build/org.eclipse.cdt.managedbuilder.ui/OSGI-INF/org.eclipse.cdt.managedbuilder.internal.ui.compilationdatabase.PreferenceConfigurationAccess.xml b/build/org.eclipse.cdt.managedbuilder.ui/OSGI-INF/org.eclipse.cdt.managedbuilder.internal.ui.compilationdatabase.PreferenceConfigurationAccess.xml index 378faf3f27d..45f61850759 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/OSGI-INF/org.eclipse.cdt.managedbuilder.internal.ui.compilationdatabase.PreferenceConfigurationAccess.xml +++ b/build/org.eclipse.cdt.managedbuilder.ui/OSGI-INF/org.eclipse.cdt.managedbuilder.internal.ui.compilationdatabase.PreferenceConfigurationAccess.xml @@ -5,6 +5,6 @@ - + \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/.settings/org.eclipse.jdt.core.prefs b/core/org.eclipse.cdt.core.tests/.settings/org.eclipse.jdt.core.prefs index afec999c9e1..523bc391368 100644 --- a/core/org.eclipse.cdt.core.tests/.settings/org.eclipse.jdt.core.prefs +++ b/core/org.eclipse.cdt.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,5 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled org.eclipse.jdt.core.builder.cleanOutputFolder=clean org.eclipse.jdt.core.builder.duplicateResourceTask=warning org.eclipse.jdt.core.builder.invalidClasspath=abort @@ -25,9 +26,12 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning +org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 @@ -39,6 +43,7 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore @@ -61,8 +66,10 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled @@ -113,6 +120,7 @@ org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning @@ -136,13 +144,14 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverridin org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLambdaParameter=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning diff --git a/core/org.eclipse.cdt.core.tests/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.core.tests/META-INF/MANIFEST.MF index ac42fc23d47..6ef064cb313 100644 --- a/core/org.eclipse.cdt.core.tests/META-INF/MANIFEST.MF +++ b/core/org.eclipse.cdt.core.tests/META-INF/MANIFEST.MF @@ -36,7 +36,6 @@ Export-Package: org.eclipse.cdt.core.cdescriptor.tests, Require-Bundle: org.eclipse.core.resources;bundle-version="[3.22.200,4)", org.eclipse.cdt.core;bundle-version="[9.1.0,10)", org.junit;bundle-version="[4.13.2,5)", - org.eclipse.jdt.junit4.runtime;bundle-version="[1.3.100,2)", org.eclipse.core.runtime;bundle-version="[3.33.0,4)", org.eclipse.ui.ide;bundle-version="[3.22.600,4)", org.eclipse.ui;bundle-version="[3.207.200,4)", diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java index 0b56d380d5c..ed53890910b 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java @@ -15,6 +15,11 @@ package org.eclipse.cdt.core.parser.tests.ast2; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.ArrayList; import java.util.List; @@ -58,22 +63,10 @@ import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.internal.core.dom.parser.ASTNode; import org.eclipse.cdt.internal.core.dom.parser.ASTTokenList; - -import junit.framework.TestSuite; +import org.junit.jupiter.api.Test; public class AST2CPPAttributeTests extends AST2TestBase { - public AST2CPPAttributeTests() { - } - - public AST2CPPAttributeTests(String name) { - super(name); - } - - public static TestSuite suite() { - return suite(AST2CPPAttributeTests.class); - } - private IASTTranslationUnit parseAndCheckBindings() throws Exception { String code = getAboveComment(); return parseAndCheckBindings(code, ParserLanguage.CPP); @@ -154,18 +147,21 @@ private void checkAttributeRelations(List specifiers, } // auto t = []() mutable throw(char const *) [[attr]] { throw "exception"; }; + @Test public void testAttributedLambda() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTFunctionDeclarator.class); } // int * arr = new int[1][[attr]]{2}; + @Test public void testAttributedNewArrayExpression() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTArrayModifier.class); } // int (* matrix) = new int[2][[attr1]][2][[attr2]]; + @Test public void testAttributedMultidimensionalNewArrayExpression() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); List specifiers = getAttributeSpecifiers(tu); @@ -180,6 +176,7 @@ public void testAttributedMultidimensionalNewArrayExpression() throws Exception // void foo() { // [[attr]] label:; // } + @Test public void testAttributeInLabeledStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTLabelStatement.class); @@ -192,6 +189,7 @@ public void testAttributeInLabeledStatement() throws Exception { // ; // } // } + @Test public void testAttributedSwitchLabels() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); List specifiers = getAttributeSpecifiers(tu); @@ -202,6 +200,7 @@ public void testAttributedSwitchLabels() throws Exception { // int i{0}; // [[attr]] i++; // } + @Test public void testAttributedExpressionStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTExpressionStatement.class); @@ -210,6 +209,7 @@ public void testAttributedExpressionStatement() throws Exception { // void foo() { // [[attr]] {} // } + @Test public void testAttributedCompoundStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTCompoundStatement.class); @@ -218,6 +218,7 @@ public void testAttributedCompoundStatement() throws Exception { // void foo() { // [[attr]] if(false); // } + @Test public void testAttributedSelectionStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTIfStatement.class); @@ -226,6 +227,7 @@ public void testAttributedSelectionStatement() throws Exception { // void foo() { // [[attr]] while(false); // } + @Test public void testAttributedIterationStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTWhileStatement.class); @@ -234,6 +236,7 @@ public void testAttributedIterationStatement() throws Exception { // void foo() { // [[attr]] return; // } + @Test public void testAttributedJumpStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTReturnStatement.class); @@ -242,6 +245,7 @@ public void testAttributedJumpStatement() throws Exception { // void foo() { // [[attr]] try{} catch(...) {} // } + @Test public void testAttributedTryBlockStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTTryBlockStatement.class); @@ -250,6 +254,7 @@ public void testAttributedTryBlockStatement() throws Exception { // void foo() { // if([[attr]]int i{0}); // } + @Test public void testAttributedConditionWithInitializer() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTSimpleDeclaration.class); @@ -259,18 +264,21 @@ public void testAttributedConditionWithInitializer() throws Exception { // int a[1]{0}; // for([[attr]]auto i : a){} // } + @Test public void testAttributedForRangeDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTSimpleDeclaration.class); } // using number [[attr]] = int; + @Test public void testAttributedAliasDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTAliasDeclaration.class); } // enum [[attr]] e {}; + @Test public void testAttributedEnumDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTEnumerationSpecifier.class); @@ -278,6 +286,7 @@ public void testAttributedEnumDeclaration() throws Exception { // namespace NS{} // [[attr]] using namespace NS; + @Test public void testAttributedUsingDirective() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTUsingDirective.class); @@ -286,6 +295,7 @@ public void testAttributedUsingDirective() throws Exception { // void foo() throw(char const *) [[noreturn]] -> void { // throw "exception"; // } + @Test public void testTrailingNoreturnFunctionDefinition() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDeclarator.class); @@ -294,60 +304,70 @@ public void testTrailingNoreturnFunctionDefinition() throws Exception { // [[noreturn]] void foo() throw(char const *) { // throw "exception"; // } + @Test public void testLeadingNoreturnFunctionDefinition() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDefinition.class); } // void foo() throw(char const *) [[noreturn]]; + @Test public void testTrailingNoReturnFunctionDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDeclarator.class); } // [[noreturn]] void foo() throw(char const *); + @Test public void testLeadingNoReturnFunctionDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTSimpleDeclaration.class); } // class [[attr]] C{}; + @Test public void testAttributedClass() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTCompositeTypeSpecifier.class); } // void f() { try { } catch ([[attr]] int& id) {} } + @Test public void testAttributedExceptionDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTSimpleDeclaration.class); } // struct [[attr]] S; + @Test public void testAttributedElaboratedTypeSpecifier() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTElaboratedTypeSpecifier.class); } // static int [[int_attr]] v; + @Test public void testAttributedDeclSpecifier() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTSimpleDeclSpecifier.class); } //auto [[maybe_unused]] variable; + @Test public void testAttributeAutoDeclSpecifer() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTSimpleDeclSpecifier.class); } // const volatile unsigned long int [[attr]] cvuli; + @Test public void testAttributedTypeSpecifier() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTSimpleDeclSpecifier.class); } // int * [[pointer_attribute]] * [[pointer_attribute]] ipp; + @Test public void testAttributedPtrOperators() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); List specifiers = getAttributeSpecifiers(tu); @@ -360,42 +380,49 @@ public void testAttributedPtrOperators() throws Exception { } // int & [[ref_attribute]] iRef; + @Test public void testAttributedRefOperator() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTReferenceOperator.class); } // int && [[rvalue_ref_attribute]] iRvalueRef; + @Test public void testAttributedRvalueRefOperator() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTReferenceOperator.class); } // void foo() [[function_attr]]; + @Test public void testAttributedFunctionDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDeclarator.class); } // int ipp [[declarator_attr]]; + @Test public void testAttributedDeclarator() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTDeclarator.class); } // int iArr[5] [[arr_attr]]; + @Test public void testAttributedArrayDeclarator() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTArrayModifier.class); } // [[attr]] int i; + @Test public void testAttributedSimpleDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTSimpleDeclaration.class); } // [[attr]] void bar(){} + @Test public void testAttributedFunctionDefinition() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDefinition.class); @@ -404,6 +431,7 @@ public void testAttributedFunctionDefinition() throws Exception { // struct S { // [[ctor_attr]] S() = delete; // }; + @Test public void testDeletedCtor() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDefinition.class); @@ -412,6 +440,7 @@ public void testDeletedCtor() throws Exception { // struct S { // [[dtor_attr]] ~S() = default; // }; + @Test public void testDefaultedDtor() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDefinition.class); @@ -420,18 +449,21 @@ public void testDefaultedDtor() throws Exception { // void bar() { // [[attr]] int i; // } + @Test public void testAttributedSimpleDeclarationInStatement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); checkAttributeRelations(getAttributeSpecifiers(tu), IASTSimpleDeclaration.class); } // [[]] int i; + @Test public void testEmptyAttributeSpecifier() throws Exception { IASTAttribute[] attributes = getAttributes(); assertEquals(IASTAttribute.EMPTY_ATTRIBUTE_ARRAY, attributes); } // [[attr]] [[attr2]] [[attr3]] int i; + @Test public void testMultipleSequentialAttributeSpecifiers() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); List specifiers = getAttributeSpecifiers(tu); @@ -450,6 +482,7 @@ public void testMultipleSequentialAttributeSpecifiers() throws Exception { } // [[attr1, attr2]] int i; + @Test public void testMultipleAttributes() throws Exception { IASTAttribute[] attributes = getAttributes(); assertEquals(2, attributes.length); @@ -460,6 +493,7 @@ public void testMultipleAttributes() throws Exception { } // [[attribute ...]] int i; + @Test public void testPackExpansionAttribute() throws Exception { IASTAttribute[] attributes = getAttributes(); assertEquals(1, attributes.length); @@ -469,6 +503,7 @@ public void testPackExpansionAttribute() throws Exception { } // [[scope::attribute]] int i; + @Test public void testScopedAttribute() throws Exception { IASTAttribute[] attributes = getAttributes(); assertEquals(1, attributes.length); @@ -479,6 +514,7 @@ public void testScopedAttribute() throws Exception { } // [[attr()]] int i; + @Test public void testAttributeWithEmptyArgument() throws Exception { IASTAttribute[] attributes = getAttributes(); assertEquals(1, attributes.length); @@ -489,6 +525,7 @@ public void testAttributeWithEmptyArgument() throws Exception { } // [[attr(this(is){[my]}(argument[with]{some},parentheses))]] int i; + @Test public void testAttributeWithBalancedArgument() throws Exception { IASTAttribute[] attributes = getAttributes(); assertEquals(1, attributes.length); @@ -501,6 +538,7 @@ public void testAttributeWithBalancedArgument() throws Exception { } // [[attr(class)]] int i; + @Test public void testAttributeWithKeywordArgument() throws Exception { IASTAttribute[] attributes = getAttributes(); assertEquals(1, attributes.length); @@ -514,18 +552,21 @@ public void testAttributeWithKeywordArgument() throws Exception { } // struct S __attribute__((__packed__)) {}; + @Test public void testGCCAttributedStruct() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTCompositeTypeSpecifier.class); } // int a __attribute__ ((aligned ((64)))); + @Test public void testGCCAttributedVariableDeclarator_bug391572() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), IASTDeclarator.class); } // int a __attribute__ (()); + @Test public void testEmptyGCCAttribute() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), IASTDeclarator.class); @@ -534,6 +575,7 @@ public void testEmptyGCCAttribute() throws Exception { // struct S { // void foo() override __attribute__((attr)); // }; + @Test public void testGCCAttributeAfterOverride_bug413615() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTFunctionDeclarator.class); @@ -542,6 +584,7 @@ public void testGCCAttributeAfterOverride_bug413615() throws Exception { // enum E { // value1 [[attr1]], value2 [[attr2]] = 1 // }; + @Test public void testAttributedEnumerator_Bug535269() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), IASTEnumerator.class, IASTEnumerator.class); @@ -549,6 +592,7 @@ public void testAttributedEnumerator_Bug535269() throws Exception { //void f([[attr1]] int [[attr2]] p) { //} + @Test public void testAttributedFunctionParameter_Bug535275() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTParameterDeclaration.class, @@ -556,24 +600,28 @@ public void testAttributedFunctionParameter_Bug535275() throws Exception { } //namespace [[attr]] NS {} + @Test public void testAttributedNamedNamespace_Bug535274() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTNamespaceDefinition.class); } //namespace [[attr]] {} + @Test public void testAttributedUnnamedNamespace_Bug535274() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTNamespaceDefinition.class); } //namespace NS __attribute__((__visibility__("default"))) {} + @Test public void testGnuAndCppMixedAttributedNamedNamespace_Bug535274() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); checkAttributeRelations(getAttributeSpecifiers(tu), ICPPASTNamespaceDefinition.class); } // [[attr]] __attribute__((__visibility__("default"))) [[attr2]] __attribute__((__section__(".foo"))) int i; + @Test public void testMixedAttributeSpecifiers() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), ParserLanguage.CPP, ScannerKind.GNU); List specifiers = getAttributeSpecifiers(tu); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPImplicitNameTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPImplicitNameTests.java index eb2eb4fb699..1e3f37574ac 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPImplicitNameTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPImplicitNameTests.java @@ -16,6 +16,12 @@ *******************************************************************************/ package org.eclipse.cdt.core.parser.tests.ast2; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.IOException; import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName; @@ -31,8 +37,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance; import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.internal.core.parser.ParserException; - -import junit.framework.TestSuite; +import org.junit.jupiter.api.Test; /** * Tests for classes implementing {@link IASTImplicitNameOwner} and {@link IASTImplicitDestructorNameOwner} @@ -40,17 +45,6 @@ */ public class AST2CPPImplicitNameTests extends AST2TestBase { - public AST2CPPImplicitNameTests() { - } - - public AST2CPPImplicitNameTests(String name) { - super(name); - } - - public static TestSuite suite() { - return suite(AST2CPPImplicitNameTests.class); - } - protected BindingAssertionHelper getAssertionHelper() throws ParserException, IOException { String code = getAboveComment(); return new AST2AssertionHelper(code, ParserLanguage.CPP); @@ -103,6 +97,7 @@ protected IASTImplicitDestructorName[] getImplicitDestructorNames(IASTTranslatio // -p; // +p; // } + @Test public void testBinaryExpressions() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTTranslationUnit tu = ba.getTranslationUnit(); @@ -147,6 +142,7 @@ public void testBinaryExpressions() throws Exception { // int* y; // *y; //2 // } + @Test public void testPointerDereference() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertImplicitName("*x;", 1, ICPPFunction.class); @@ -165,6 +161,7 @@ public void testPointerDereference() throws Exception { // X (Y::*px1) = &Y::x; // not the overloaded operator // X* px2 = &y; // overloaded // } + @Test public void testPointerToMember() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTTranslationUnit tu = ba.getTranslationUnit(); @@ -198,6 +195,7 @@ public void testPointerToMember() throws Exception { // SecondLevelProxy p2; // p2->doA(); // } + @Test public void testArrowOperator() throws Exception { String contents = getAboveComment(); IASTTranslationUnit tu = parse(contents, ParserLanguage.CPP); @@ -226,6 +224,7 @@ public void testArrowOperator() throws Exception { // (p1++).x; //1 // (++p1).x; //2 // } + @Test public void testUnaryPrefixAndPostfix() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertImplicitName("++).x; //1", 2, ICPPFunction.class); @@ -252,6 +251,7 @@ public void testUnaryPrefixAndPostfix() throws Exception { // D d; // test(a, b, c, d); // func // } + @Test public void testCommaOperator1() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); // expression lists are used in function calls but they should not resolve to the comma operator @@ -287,6 +287,7 @@ public void testCommaOperator1() throws Exception { // int test(A a, B b, C c, D d) { // (a, b, c, d).ee; // expr // } + @Test public void testCommaOperator2() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); @@ -318,6 +319,7 @@ public void testCommaOperator2() throws Exception { // x(); // 2 // x(1, 2); // 3 // } + @Test public void testFunctionCallOperator() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTTranslationUnit tu = ba.getTranslationUnit(); @@ -359,6 +361,7 @@ public void testFunctionCallOperator() throws Exception { // B b; // b = a; // should not resolve // } + @Test public void testCopyAssignmentOperator() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNoImplicitName("= a;", 1); @@ -377,6 +380,7 @@ public void testCopyAssignmentOperator() throws Exception { // func(x[0]); //1 // func(y[q]); //2 // } + @Test public void testArraySubscript() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTTranslationUnit tu = ba.getTranslationUnit(); @@ -412,6 +416,7 @@ public void testArraySubscript() throws Exception { // delete[] x; // delete 1; // } + @Test public void testDelete() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTImplicitName[] names = ba.getImplicitNames("delete x;", 6); @@ -446,6 +451,7 @@ public void testDelete() throws Exception { // B* b = new B; // delete b; // } + @Test public void testOverloadedDelete_Bug351547() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IBinding m = bh.assertNonProblem("operator delete(void * a)", 15); @@ -473,6 +479,7 @@ public void testOverloadedDelete_Bug351547() throws Exception { // A *a = new A; // B* b = new B; // } + @Test public void testOverloadedNew_Bug354585() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IBinding m = bh.assertNonProblem("operator new(size_t a)", 12); @@ -492,6 +499,7 @@ public void testOverloadedNew_Bug354585() throws Exception { // X* xs = new X[5]; // delete[] x; // } + @Test public void testImplicitNewAndDelete() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNoImplicitName("new X", 3); @@ -511,6 +519,7 @@ public void testImplicitNewAndDelete() throws Exception { // int* p = new (nothrow) int[5]; // int* p2 = new (5, 6) int[5]; // } + @Test public void testNew() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTImplicitName n1 = ba.assertImplicitName("new (nothrow) X", 3, ICPPFunction.class); @@ -529,6 +538,7 @@ public void testNew() throws Exception { // int test() { // throw; // } + @Test public void testEmptyThrow() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNoImplicitName("throw;", 5); @@ -558,6 +568,7 @@ public void testEmptyThrow() throws Exception { // C(int p) : u(), v(p) {} // }; // B C::t = 1; + @Test public void testConstructorCall() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTTranslationUnit tu = ba.getTranslationUnit(); @@ -597,6 +608,7 @@ public void testConstructorCall() throws Exception { // if (aa==b) { // } // } + @Test public void testBuiltinOperators_294543() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTTranslationUnit tu = ba.getTranslationUnit(); @@ -613,6 +625,7 @@ public void testBuiltinOperators_294543() throws Exception { // int x; // x = A().a; // } + @Test public void testTemporaryDestruction() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTImplicitDestructorName[] names = ba.getImplicitDestructorNames("x = A().a"); @@ -628,6 +641,7 @@ public void testTemporaryDestruction() throws Exception { // A x; // x = A(); // } + @Test public void testTemporaryNotCreatedWhenBoundToVariable() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTImplicitDestructorName[] names = ba.getImplicitDestructorNames("x = A()"); @@ -641,6 +655,7 @@ public void testTemporaryNotCreatedWhenBoundToVariable() throws Exception { // int test() { // return (new A())->a; // } + @Test public void testTemporaryNotCreatesInNewExpression() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTImplicitDestructorName[] names = ba.getImplicitDestructorNames("(new A())->a"); @@ -654,6 +669,7 @@ public void testTemporaryNotCreatesInNewExpression() throws Exception { // void test() { // A& x = A(); // } + @Test public void testTemporaryBoundToReference() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTImplicitDestructorName[] names = ba.getImplicitDestructorNames("A()"); @@ -671,6 +687,7 @@ public void testTemporaryBoundToReference() throws Exception { // const S& s2 = S(1); // S s3; // }//1 + @Test public void testOrderOfDestruction() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IASTImplicitDestructorName[] names = ba.getImplicitDestructorNames("}//1", 1); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecTest.java index 63edd1505b0..ad053120184 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecTest.java @@ -16,6 +16,11 @@ *******************************************************************************/ package org.eclipse.cdt.core.parser.tests.ast2; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; + import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier; import org.eclipse.cdt.core.dom.ast.IASTDeclaration; @@ -44,31 +49,21 @@ import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPUnknownBinding; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor; - -import junit.framework.TestSuite; +import org.junit.jupiter.api.Test; /** * Examples taken from the c++-specification. */ public class AST2CPPSpecTest extends AST2SpecTestBase { - public AST2CPPSpecTest() { - } - - public AST2CPPSpecTest(String name) { - super(name); - } - - public static TestSuite suite() { - return suite(AST2CPPSpecTest.class); - } - // int x=x+++++y; + @Test public void test2_4s5() throws Exception { parseCandCPP(getAboveComment(), false, 0); } // int a=12, b=014, c=0XC; + @Test public void test2_13_1s1() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -76,6 +71,7 @@ public void test2_13_1s1() throws Exception { // ??=define arraycheck(a,b) a??(b??) ??!??! b??(a??) // // becomes // #define arraycheck(a,b) a[b] || b[a] + @Test public void test2_3s2() throws Exception { // TODO exists bug 64993 parseCandCPP(getAboveComment(), true, 0); } @@ -102,6 +98,7 @@ public void test2_3s2() throws Exception { // TODO exists bug 64993 // typedef int Int; // declares Int // extern X anotherX; // declares anotherX // using N::d; // declares N::d + @Test public void test3_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -115,6 +112,7 @@ public void test3_1s3() throws Exception { // C b = a; // b = a; // } + @Test public void test3_1s4a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -127,6 +125,7 @@ public void test3_1s4a() throws Exception { // ~C() { } // }; // + @Test public void test3_1s4b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -134,6 +133,7 @@ public void test3_1s4b() throws Exception { // struct X; // declare X as a struct type // struct X* x1; // use X in pointer formation // X* x2; // use X in pointer formation + @Test public void test3_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -146,6 +146,7 @@ public void test3_2s4() throws Exception { // X::X(int = 0) { } // class D: public X { }; // D d2; // X(int) called by D() + @Test public void test3_2s5_a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -159,6 +160,7 @@ public void test3_2s5_a() throws Exception { // class D: public X { }; // X(int, int) called by D(); // // D()'s implicit definition // // violates the ODR + @Test public void test3_2s5_b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -169,6 +171,7 @@ public void test3_2s5_b() throws Exception { // int i = j, j; // j = 42; // } + @Test public void test3_3s2() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -177,6 +180,7 @@ public void test3_3s2() throws Exception { // int x = 12; // { int x = x; } // } + @Test public void test3_3_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -185,6 +189,7 @@ public void test3_3_1s1() throws Exception { // const int i = 2; // { int i[i]; } // } + @Test public void test3_3_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -193,6 +198,7 @@ public void test3_3_1s2() throws Exception { // const int x = 12; // { enum { x = x }; } // } + @Test public void test3_3_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -219,6 +225,7 @@ public void test3_3_1s3() throws Exception { // } // int q(); // error: different return type // } + @Test public void test3_3_5s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -236,6 +243,7 @@ public void test3_3_5s1() throws Exception { // // 3) scope of namespace A // // 4) global scope, before the definition of A::N::f // } + @Test public void test3_4_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -243,6 +251,7 @@ public void test3_4_1s6() throws Exception { // namespace M { // class B { }; // } + @Test public void test3_4_1s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -265,6 +274,7 @@ public void test3_4_1s7() throws Exception { // // 4) scope of namespace M::N // // 5) scope of namespace M // // 6) global scope, before the definition of M::N::X::f + @Test public void test3_4_1s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -279,6 +289,7 @@ public void test3_4_1s8() throws Exception { // friend void A::f1(AT); // parameter type is A::AT // friend void A::f2(BT); // parameter type is B::BT // }; + @Test public void test3_4_1s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -293,6 +304,7 @@ public void test3_4_1s10() throws Exception { // A::n = 42; // OK // A b; // illformed: A does not name a type // } + @Test public void test3_4_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 1); } @@ -305,6 +317,7 @@ public void test3_4_3s1() throws Exception { // int main() { // f(parm); //OK: calls NS::f // } + @Test public void test3_4_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -318,6 +331,7 @@ public void test3_4_2s2() throws Exception { // X C::arr[number]; // illformed: // // equivalent to: ::X C::arr[C::number]; // // not to: C::X C::arr[C::number]; + @Test public void test3_4_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -342,6 +356,7 @@ public void test3_4_3s3() throws Exception { // AB *p; // p->AB::~AB(); // explicitly calls the destructor for A // } + @Test public void test3_4_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -395,6 +410,7 @@ public void test3_4_3s5() throws Exception { // // S is { Y::h(int), Z::h(double) } and overload // // resolution chooses Z::h(double) // } + @Test public void test3_4_3_2s2() throws Exception { String[] problems = { "AB::x", "x", "AB::i", "i" }; parse(getAboveComment(), ParserLanguage.CPP, problems); // qualified names are counted double, so 4 @@ -428,6 +444,7 @@ public void test3_4_3_2s2() throws Exception { // { // BD::a++; //OK: S is { A::a, A::a } // } + @Test public void test3_4_3_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -449,6 +466,7 @@ public void test3_4_3_2s3() throws Exception { // A::b++; //OK: both A and B searched (once), S is { B::b } // B::b++; //OK: b declared directly in B, S is { B::b } // } + @Test public void test3_4_3_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -467,6 +485,7 @@ public void test3_4_3_2s4() throws Exception { // int i = C::x; // OK, A::x (of type int) // int j = C::y; // ambiguous, A::y or B::y // } + @Test public void test3_4_3_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -479,6 +498,7 @@ public void test3_4_3_2s5() throws Exception { // } // void A::f1(int) { } // illformed, // // f1 is not a member of A + @Test public void test3_4_3_2s6a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -496,6 +516,7 @@ public void test3_4_3_2s6a() throws Exception { // using namespace A; // using namespace C::D; // void B::f1(int){} // OK, defines A::B::f1(int) + @Test public void test3_4_3_2s6b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -528,6 +549,7 @@ public void test3_4_3_2s6b() throws Exception { // struct Base::Data; // error: cannot introduce a qualified type (7.1.5.3) // struct Base::Datum; // error: Datum undefined // struct Base::Data* pBase; // OK: refers to nested Data + @Test public void test3_4_4s3() throws Exception { String[] problems = { "::Glob", "Glob", "Base::Datum", "Datum" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -543,6 +565,7 @@ public void test3_4_4s3() throws Exception { // extern int i; //3: external linkage // } // } + @Test public void test3_5s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -562,6 +585,7 @@ public void test3_5s6() throws Exception { // } // void q() { // // } // some other, unrelated q + @Test public void test3_5s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -573,12 +597,14 @@ public void test3_5s7() throws Exception { // typedef A B; // extern B b; // illformed // } + @Test public void test3_5s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // int main(int argc, char* argv[]) { // // } + @Test public void test3_6_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -603,6 +629,7 @@ public void test3_6_1s2() throws Exception { // void* q = pb; // OK: pb points to valid memory // pb->f(); //undefined behavior, lifetime of *pb has ended // } + @Test public void test3_8s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -627,6 +654,7 @@ public void test3_8s5() throws Exception { // c1 = c2; // welldefined // c1.f(); //welldefined; c1 refers to a new object of type C // } + @Test public void test3_8s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -639,6 +667,7 @@ public void test3_8s7() throws Exception { // B b; // new (&b) T; // } //undefined behavior at block exit + @Test public void test3_8s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -652,6 +681,7 @@ public void test3_8s8() throws Exception { // b.~B(); // new (&b) const B; // undefined behavior // } + @Test public void test3_8s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -665,6 +695,7 @@ public void test3_8s9() throws Exception { // memcpy(&obj, buf, N); // at this point, each subobject of obj of scalar type // // holds its original value // } + @Test public void test3_9s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -676,6 +707,7 @@ public void test3_9s2() throws Exception { // memcpy(t1p, t2p, sizeof(T)); // at this point, every subobject of POD type in *t1p contains // // the same value as the corresponding subobject in *t2p // } + @Test public void test3_9s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -702,11 +734,13 @@ public void test3_9s3() throws Exception { // xp++; //OK: X is complete // arrp++; //ill-formed: UNKA can't be completed // } + @Test public void test3_9s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // int& f(); + @Test public void test3_10s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -717,6 +751,7 @@ public void test3_10s3() throws Exception { // i = ++i + 1; // the behavior is unspecified // i = i + 1; // the value of i is incremented // } + @Test public void test5s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -727,6 +762,7 @@ public void test5s4() throws Exception { // { // B* bp = dynamic_cast(dp); // equivalent to B* bp = dp; // } + @Test public void test5_2_7s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -757,6 +793,7 @@ public void test5_2_7s5() throws Exception { // // cast from virtual base // E* ep1 = dynamic_cast(ap); // succeeds // } + @Test public void test5_2_7s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -771,6 +808,7 @@ public void test5_2_7s9() throws Exception { // typeid(D) == typeid(d2); // yields true // typeid(D) == typeid(const D&); // yields true // } + @Test public void test5_2_8s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -782,6 +820,7 @@ public void test5_2_8s5() throws Exception { // int foo() { // static_cast(br); // produces lvalue to the original d object // } + @Test public void test5_2_9s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -791,6 +830,7 @@ public void test5_2_9s5() throws Exception { // int foo() { // &B::i; // has type int A::* // } + @Test public void test5_3_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -798,6 +838,7 @@ public void test5_3_1s2() throws Exception { // void test() { // new (int (*[10])()); // }; + @Test public void test5_3_4s3() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), ParserLanguage.CPP, true, 0); IASTFunctionDefinition fdef = getDeclaration(tu, 0); @@ -818,6 +859,7 @@ public void test5_3_4s3() throws Exception { // new T[5]; // new (2,f) T[5]; // }; + @Test public void test5_3_4s12() throws Exception { // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=236856 @@ -860,12 +902,14 @@ public void test5_3_4s12() throws Exception { // int n=2; // int x=new float[n][5]; // int y=new float[5][n]; + @Test public void test5_3_4s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // const char* strchr(const char* s, int c); // bool b = noexcept (strchr("abc", 'b')); + @Test public void test5_3_7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -878,6 +922,7 @@ public void test5_3_7() throws Exception { // return (A*)( p ); // illformed // // static_cast interpretation // } + @Test public void test5_4s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -885,6 +930,7 @@ public void test5_4s5() throws Exception { // int foo() { // (ptr_to_obj->*ptr_to_mfct)(10); // } + @Test public void test5_5s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -898,6 +944,7 @@ public void test5_5s6() throws Exception { // p <= q; // Both converted to const void * before comparison // pi <= pci; // Both converted to const int *const * before comparison // } + @Test public void test5_9s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -914,6 +961,7 @@ public void test5_9s2() throws Exception { // int (D::*pdl)() = pl; // int (D::*pdr)() = pr; // bool x = (pdl == pdr); // false + @Test public void test5_10s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -923,6 +971,7 @@ public void test5_10s2() throws Exception { // int a=0, t=1, c=2; // f(a, (t=3, t+2), c); // } + @Test public void test5_18s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -936,6 +985,7 @@ public void test5_18s2() throws Exception { // int i; // } // } + @Test public void test6_4s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -948,6 +998,7 @@ public void test6_4s1() throws Exception { // int x; // illformed,redeclaration of x // } // } + @Test public void test6_4s3() throws Exception { // raised bug 90618 // gcc does not report an error, either, so leave it as it is. @@ -963,6 +1014,7 @@ public void test6_4s3() throws Exception { // int i; // } // } + @Test public void test6_5s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -981,6 +1033,7 @@ public void test6_5s3() throws Exception { // i = 0; // } // } + @Test public void test6_5_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -992,6 +1045,7 @@ public void test6_5_1s2() throws Exception { // a[i] = i; // int j = i; // j = 42 // } + @Test public void test6_5_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1009,6 +1063,7 @@ public void test6_5_3s3() throws Exception { // // call for a followed by construction // // again immediately following label ly // } + @Test public void test6_7s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 1); } @@ -1018,6 +1073,7 @@ public void test6_7s3() throws Exception { // static int s = foo(2*i); // recursive call - undefined // return i+1; // } + @Test public void test6_7s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1031,6 +1087,7 @@ public void test6_7s4() throws Exception { // T(f) = { 1, 2 }; // declaration // T(*g)(double(3)); // declaration // } + @Test public void test6_8s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -1048,6 +1105,7 @@ public void test6_8s1() throws Exception { // T(d),e,f=3; //declaration // extern int h; // T(g)(h,2); //declaration + @Test public void test6_8s2() throws Exception { // TODO raised bug 90622 parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1071,6 +1129,7 @@ public void test6_8s2() throws Exception { // TODO raised bug 90622 // // properly since it depends // // on T2 being a typename // } + @Test public void test6_8s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1078,12 +1137,14 @@ public void test6_8s3() throws Exception { // typedef char* Pc; // void f(const Pc); // void f(char* const) (not const char*) // void g(const int Pc); // void g(const int) + @Test public void test7_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // void h(unsigned Pc); // void h(unsigned int) // void k(unsigned int Pc); // void k(unsigned int) + @Test public void test7_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1091,6 +1152,7 @@ public void test7_1s3() throws Exception { // thread_local int e; // static thread_local int f; // extern thread_local int g; + @Test public void test7_1_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1119,6 +1181,7 @@ public void test7_1_1s1() throws Exception { // static int c; // error: inconsistent linkage // extern int d; // d has external linkage // static int d; // error: inconsistent linkage + @Test public void test7_1_1s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1132,6 +1195,7 @@ public void test7_1_1s7() throws Exception { // g(a); //error: S is incomplete // f(); //error: S is incomplete // } + @Test public void test7_1_1s8a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1140,6 +1204,7 @@ public void test7_1_1s8a() throws Exception { // mutable const int* p; // OK // mutable int* const q; // illformed // }; + @Test public void test7_1_1s8b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1147,6 +1212,7 @@ public void test7_1_1s8b() throws Exception { // typedef int MILES, *KLICKSP; // MILES distance; // extern KLICKSP metricp; + @Test public void test7_1_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1156,6 +1222,7 @@ public void test7_1_3s1() throws Exception { // typedef int I; // typedef int I; // typedef I I; + @Test public void test7_1_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1163,6 +1230,7 @@ public void test7_1_3s2() throws Exception { // class complex { // // }; // typedef int complex; // error: redefinition + @Test public void test7_1_3s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1170,6 +1238,7 @@ public void test7_1_3s3a() throws Exception { // typedef int complex; // class complex { // // }; // error: redefinition + @Test public void test7_1_3s3b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1181,11 +1250,13 @@ public void test7_1_3s3b() throws Exception { // typedef struct S T; // S a = T(); // OK // struct T * p; // error + @Test public void test7_1_3s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // typedef struct { } *ps, S; // S is the class name for linkage purposes + @Test public void test7_1_3s5a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1194,6 +1265,7 @@ public void test7_1_3s5a() throws Exception { // S(); //error: requires a return type because S is // // an ordinary member function, not a constructor // } S; + @Test public void test7_1_3s5b() throws Exception { IASTTranslationUnit tu = parseWithErrors(getAboveComment(), ParserLanguage.CPP); IASTCompositeTypeSpecifier comp = getCompositeType(tu, 0); @@ -1215,6 +1287,7 @@ public void test7_1_3s5b() throws Exception { // return x * x; // } // constexpr pixel large(4); + @Test public void test7_1_5s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1233,6 +1306,7 @@ public void test7_1_5s1() throws Exception { // int* iq = const_cast(ciq); // cast required // *iq = 4; // undefined: modifies a const object // } + @Test public void test7_1_5_1s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1256,12 +1330,14 @@ public void test7_1_5_1s5() throws Exception { // p->x.i = 99; // wellformed: mutable member can be modified // p->x.j = 99; // undefined: modifies a const member // } + @Test public void test7_1_5_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // enum { a, b, c=0 }; // enum { d, e, f=e+2 }; + @Test public void test7_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1270,6 +1346,7 @@ public void test7_2s2() throws Exception { // const int x = 12; // { enum { x = x }; } // } + @Test public void test7_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1281,6 +1358,7 @@ public void test7_2s3() throws Exception { // if (*cp == blue) // ... // return 0; // } + @Test public void test7_2s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1302,6 +1380,7 @@ public void test7_2s8() throws Exception { // f(p->left); // OK // // ... // } + @Test public void test7_2s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -1314,6 +1393,7 @@ public void test7_2s10() throws Exception { // void g() { i++; } // Inner::i // } // } + @Test public void test7_3_1s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1333,6 +1413,7 @@ public void test7_3_1s5() throws Exception { // A::i++; // A::unique::i // j++; // A::unique::j // } + @Test public void test7_3_1_1s1() throws Exception { String[] problems = { "i" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -1342,6 +1423,7 @@ public void test7_3_1_1s1() throws Exception { // void f() { // // } // } + @Test public void test7_3_1_2s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1359,6 +1441,7 @@ public void test7_3_1_2s1() throws Exception { // namespace R { // void Q::V::g() { } // error: R doesn't enclose Q // } + @Test public void test7_3_1_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 2); } @@ -1388,6 +1471,7 @@ public void test7_3_1_2s2() throws Exception { // A::X::f(x); //error: f is not a member of A::X // A::X::Y::g(); // error: g is not a member of A::X::Y // } + @Test public void test7_3_1_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 4); } @@ -1396,6 +1480,7 @@ public void test7_3_1_2s3() throws Exception { // namespace CWVLN = Company_with_very_long_name; // namespace CWVLN = Company_with_very_long_name; // OK: duplicate // namespace CWVLN = CWVLN; + @Test public void test7_3_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1411,6 +1496,7 @@ public void test7_3_2s3() throws Exception { // void f(int) { f('c'); } // calls B::f(char) // void g(int) { g('c'); } // recursively calls D::g(int) // }; + @Test public void test7_3_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1424,6 +1510,7 @@ public void test7_3_3s3() throws Exception { // using B::x; // OK: x is a union member of base B // using C::g; // error: C isn't a base of D2 // }; + @Test public void test7_3_3s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -1438,6 +1525,7 @@ public void test7_3_3s4() throws Exception { // using A::f; // illformed // using A::X; // illformed // }; + @Test public void test7_3_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1453,6 +1541,7 @@ public void test7_3_3s5() throws Exception { // using X::s; // error: X::s is a class member // // and this is not a member declaration. // } + @Test public void test7_3_3s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1470,6 +1559,7 @@ public void test7_3_3s6() throws Exception { // X::f(); //calls ::f // X::g(); //calls A::g // } + @Test public void test7_3_3s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1494,6 +1584,7 @@ public void test7_3_3s7() throws Exception { // using B::i; // using B::i; // error: double member declaration // }; + @Test public void test7_3_3s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1516,6 +1607,7 @@ public void test7_3_3s8() throws Exception { // // that is, for A::f(int) and A::f(char). // f('a'); //calls f(char) // } + @Test public void test7_3_3s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1541,6 +1633,7 @@ public void test7_3_3s9() throws Exception { // p->g(1); //calls B::g(int) // p->g('a'); //calls D::g(char) // } + @Test public void test7_3_3s12() throws Exception { // raised bug 161562 for that parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1571,6 +1664,7 @@ public void test7_3_3s12() throws Exception { // raised bug 161562 for that // x = 99; // assigns to A::x // struct x x1; // x1 has class type B::x // } + @Test public void test7_3_3s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1593,6 +1687,7 @@ public void test7_3_3s10() throws Exception { // void f(int); // error: // // f(int) conflicts with C::f(int) and B::f(int) // } + @Test public void test7_3_3s11() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -1611,6 +1706,7 @@ public void test7_3_3s11() throws Exception { // return d> // x(); // ambiguous: B::x or C::x // } + @Test public void test7_3_3s14() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -1628,6 +1724,7 @@ public void test7_3_3s14() throws Exception { // public: // using A::g; // B::g is a public synonym for A::g // }; + @Test public void test7_3_3s15() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1657,6 +1754,7 @@ public void test7_3_3s15() throws Exception { // void f4() { // i = 5; // illformed; neither i is visible // } + @Test public void test7_3_4s1() throws Exception { String[] problems = { "i", "i" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -1674,6 +1772,7 @@ public void test7_3_4s1() throws Exception { // using namespace N; // i = 7; // error: both M::i and N::i are visible // } + @Test public void test7_3_4s2a() throws Exception { String[] problems = { "i" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -1699,6 +1798,7 @@ public void test7_3_4s2a() throws Exception { // int n = j; // D::j hides B::j // } // } + @Test public void test7_3_4s2b() throws Exception { String[] problems = { "k" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -1729,6 +1829,7 @@ public void test7_3_4s2b() throws Exception { // f(1); //error: ambiguous: D::f(int) or E::f(int)? // f('a'); //OK: D::f(char) // } + @Test public void test7_3_4s5() throws Exception { String[] problems = { "d1", "f" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -1738,6 +1839,7 @@ public void test7_3_4s5() throws Exception { // extern "C" { // double sqrt(double); // C linkage // } + @Test public void test7_5s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -1753,6 +1855,7 @@ public void test7_5s3() throws Exception { // void (*pf2)(FUNC*); // the name of the variable pf2 has C++ linkage and // // the type of pf2 is pointer to C++ function that // // takes one parameter of type pointer to C function + @Test public void test7_5s4a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1777,6 +1880,7 @@ public void test7_5s4a() throws Exception { // // C function // }; // } + @Test public void test7_5s4b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1800,12 +1904,14 @@ public void test7_5s4b() throws Exception { // // definition for the function h // // with C language linkage // // A::h and ::h refer to the same function + @Test public void test7_5s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // extern "C" double f(); // static double f(); // error + @Test public void test7_5s7a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1814,11 +1920,13 @@ public void test7_5s7a() throws Exception { // extern "C" { // int i; // definition // } + @Test public void test7_5s7b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // extern "C" static void f(); // error + @Test public void test7_5s7c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1829,6 +1937,7 @@ public void test7_5s7c() throws Exception { // int (*p3i)[3]; // int *f(); // int (*pf)(double); + @Test public void test8_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1843,6 +1952,7 @@ public void test8_1s1() throws Exception { // S y((int)a); // object declaration // S z = int(a); // object declaration // } + @Test public void test8_2s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1853,6 +1963,7 @@ public void test8_2s1() throws Exception { // }; // S x; // typeid // S y; // expression (illformed) + @Test public void test8_2s4() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), ParserLanguage.CPP, true, 1); NameCollector col = new NameCollector(); @@ -1872,6 +1983,7 @@ public void test8_2s4() throws Exception { // sizeof(int(1)); // expression // // sizeof(int()); // typeid (illformed) // } + @Test public void test8_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1881,6 +1993,7 @@ public void test8_2s5() throws Exception { // (int(1)); //expression // // (int())1; //typeid (illformed) // } + @Test public void test8_2s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1893,6 +2006,7 @@ public void test8_2s6() throws Exception { // f(1); //error: cannot convert 1 to function pointer // f(g); //OK // } + @Test public void test8_2s7a() throws Exception { // TODO raised bug 90633 final String code = getAboveComment(); parse(code, ParserLanguage.CPP, true, 1); @@ -1905,6 +2019,7 @@ public void test8_2s7a() throws Exception { // TODO raised bug 90633 // class C { }; // void h(int *(C[10])); // void h(int *(*_fp)(C _parm[10])); // // not: void h(int *C[10]); + @Test public void test8_2s7b() throws Exception { final String code = getAboveComment(); parse(code, ParserLanguage.CPP, true, 0); @@ -1920,11 +2035,13 @@ public void test8_2s7b() throws Exception { // void A::B::f() { } // illformed: the declarator must not be // // qualified with A:: // } + @Test public void test8_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // int unsigned i; + @Test public void test8_3s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1940,6 +2057,7 @@ public void test8_3s4() throws Exception { // pc = p; // ppc = &pc; // } + @Test public void test8_3_1s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1955,6 +2073,7 @@ public void test8_3_1s2a() throws Exception { // p = pc; // error // ppc = &p; // error // } + @Test public void test8_3_1s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1965,6 +2084,7 @@ public void test8_3_1s2b() throws Exception { // *ppc = &ci; // OK, but would make p point to ci ... // *p = 5; // clobber ci // } + @Test public void test8_3_1s2c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -1972,6 +2092,7 @@ public void test8_3_1s2c() throws Exception { // typedef int& A; // const A aref = 3; // illformed; // // nonconst reference initialized with rvalue + @Test public void test8_3_2s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2003,6 +2124,7 @@ public void test8_3_2s1() throws Exception { // link* q = new link; // h(q); // } + @Test public void test8_3_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2026,6 +2148,7 @@ public void test8_3_2s3() throws Exception { // (obj.*pmf)(7); //call a function member of obj // // with the argument 7 // } + @Test public void test8_3_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2033,17 +2156,20 @@ public void test8_3_3s2() throws Exception { // typedef int A[5], AA[2][3]; // typedef const A CA; // type is ''array of 5 const int'' // typedef const AA CAA; // type is ''array of 2 array of 3 const int'' + @Test public void test8_3_4s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // float fa[17], *afp[17]; // static int x3d[3][5][7]; + @Test public void test8_3_4s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // int x[3][5]; + @Test public void test8_3_4s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2054,6 +2180,7 @@ public void test8_3_4s8() throws Exception { // printf("hello world"); // printf("a=%d b=%d", a, b); // } + @Test public void test8_3_5s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2063,12 +2190,14 @@ public void test8_3_5s2() throws Exception { // const F f; // illformed: // // not equivalent to: void f() const; // }; + @Test public void test8_3_5s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // #define FILE int // int fseek(FILE*, long, int); + @Test public void test8_3_5s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2077,6 +2206,7 @@ public void test8_3_5s5() throws Exception { // F fv; // OK: equivalent to void fv(); // // F fv { } // illformed // void fv() { } // OK: definition of fv + @Test public void test8_3_5s7a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2088,6 +2218,7 @@ public void test8_3_5s7a() throws Exception { // FIC f; // OK // }; // FIC S::*pm = &S::f; // OK + @Test public void test8_3_5s7b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2098,12 +2229,14 @@ public void test8_3_5s7b() throws Exception { // *fpi(int), // (*pif)(const char*, const char*), // (*fpif(int))(int); + @Test public void test8_3_5s9a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // typedef int IFUNC(int); // IFUNC* fpif(int); + @Test public void test8_3_5s9b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2112,6 +2245,7 @@ public void test8_3_5s9b() throws Exception { // void f() { // point(1,2); point(1); point(); // } + @Test public void test8_3_6s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2137,6 +2271,7 @@ public void test8_3_6s2() throws Exception { // { // f(6); //OK, calls f(6, 7) // } + @Test public void test8_3_6s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2151,6 +2286,7 @@ public void test8_3_6s4() throws Exception { // g(); // g(f(::a)) // } // } + @Test public void test8_3_6s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2163,6 +2299,7 @@ public void test8_3_6s5() throws Exception { // { } // specified in class scope // void C::g(int i = 88, int j) // in this translation unit, // { } + @Test public void test8_3_6s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2173,6 +2310,7 @@ public void test8_3_6s6() throws Exception { // extern void g(int x = i); // error // // ... // } + @Test public void test8_3_6s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2180,6 +2318,7 @@ public void test8_3_6s7() throws Exception { // class A { // void f(A* p = this) { } // error // }; + @Test public void test8_3_6s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2190,6 +2329,7 @@ public void test8_3_6s8() throws Exception { // typedef int I; // int g(float I, int b = I(2)); // error: parameter I found // int h(int a, int b = sizeof(a)); // error, parameter a used + @Test public void test8_3_6s9a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2202,6 +2342,7 @@ public void test8_3_6s9a() throws Exception { // int mem2(int i = b); // OK; use X::b // static int b; // }; + @Test public void test8_3_6s9b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2214,6 +2355,7 @@ public void test8_3_6s9b() throws Exception { // } // int (*p1)(int) = &f; // int (*p2)() = &f; // error: type mismatch + @Test public void test8_3_6s9c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2231,6 +2373,7 @@ public void test8_3_6s9c() throws Exception { // pa->f(); //OK, calls pa->B::f(7) // pb->f(); //error: wrong number of arguments for B::f() // } + @Test public void test8_3_6s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2240,6 +2383,7 @@ public void test8_3_6s10() throws Exception { // int m = (a > b) ? a : b; // return (m > c) ? m : c; // } + @Test public void test8_4s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2257,6 +2401,7 @@ public void test8_4s2() throws Exception { // void g() volatile const& {} // void h() volatile const&& {} //}; + @Test public void test8s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2265,6 +2410,7 @@ public void test8s4() throws Exception { // { // //printf("a = %d",a); // } + @Test public void test8_4s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2276,6 +2422,7 @@ public void test8_4s5() throws Exception { // }; // int X::a = 1; // int X::b = a; // X::b = X::a + @Test public void test8_5s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2287,11 +2434,13 @@ public void test8_5s10() throws Exception { // int j; // } b; // } a = { 1, { 2, 3 } }; + @Test public void test8_5_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // int x[] = { 1, 3, 5 }; + @Test public void test8_5_1s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2301,17 +2450,20 @@ public void test8_5_1s4() throws Exception { // static int s; // int j; // } a = { 1, 2 }; + @Test public void test8_5_1s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // char cv[4] = { 'a', 's', 'd', 'f', 0 }; // error + @Test public void test8_5_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // struct S { int a; char* b; int c; }; // S ss = { 1, "asdf" }; + @Test public void test8_5_1s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2321,6 +2473,7 @@ public void test8_5_1s7() throws Exception { // S s; // int i; // } a = { { } , 3 }; + @Test public void test8_5_1s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2329,6 +2482,7 @@ public void test8_5_1s8() throws Exception { // float y[4][3] = { // { 1 }, { 2 }, { 3 }, { 4 } // }; + @Test public void test8_5_1s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2338,6 +2492,7 @@ public void test8_5_1s10() throws Exception { // { 2, 4, 6 }, // { 3, 5, 7 }, // }; + @Test public void test8_5_1s11a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2345,6 +2500,7 @@ public void test8_5_1s11a() throws Exception { // float y[4][3] = { // 1, 3, 5, 2, 4, 6, 3, 5, 7 // }; + @Test public void test8_5_1s11b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2359,6 +2515,7 @@ public void test8_5_1s11b() throws Exception { // }; // A a; // B b = { 4, a, a }; + @Test public void test8_5_1s12() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2369,17 +2526,20 @@ public void test8_5_1s12() throws Exception { // u c = 1; // error // u d = { 0, "asdf" }; // error // u e = { "asdf" }; // error + @Test public void test8_5_1s15() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // char msg[] = "Syntax error on line %s"; + @Test public void test8_5_2s1() throws Exception { // raised bug 90647 parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // char cv[4] = "asdf"; // error + @Test public void test8_5_2s2() throws Exception { // we do not check the size of an array, which is ok. parse(getAboveComment(), ParserLanguage.CPP, true, 0); @@ -2387,6 +2547,7 @@ public void test8_5_2s2() throws Exception { // int& r1; // error: initializer missing // extern int& r2; // OK + @Test public void test8_5_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2414,6 +2575,7 @@ public void test8_5_3s2() throws Exception { // f5(b); // f6(B()); // } + @Test public void test8_5_3s5a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2425,6 +2587,7 @@ public void test8_5_3s5a() throws Exception { // int i = 2; // f2(i); // error: type mismatch and reference not const // } + @Test public void test8_5_3s5b() throws Exception { BindingAssertionHelper helper = getAssertionHelper(ParserLanguage.CPP); helper.assertProblem("f1(2", "f1"); @@ -2450,6 +2613,7 @@ public void test8_5_3s5b() throws Exception { // f4(x); // bound directly to the result of operator B // f3(X()); // error: lvalue-to-rvalue conversion applied to result of operator int& // } + @Test public void test8_5_3s5c() throws Exception { BindingAssertionHelper helper = getAssertionHelper(ParserLanguage.CPP); helper.assertNonProblem("f1(f", "f1"); @@ -2473,6 +2637,7 @@ public void test8_5_3s5c() throws Exception { // f2(d); // error: copying lvalue of related type // f2(i); // } + @Test public void test8_5_3s5d() throws Exception { BindingAssertionHelper helper = getAssertionHelper(ParserLanguage.CPP); helper.assertNonProblem("f1(2", "f1"); @@ -2495,6 +2660,7 @@ public void test8_5_3s5d() throws Exception { // int f(Y); // struct S { int a; }; // struct S { int a; }; // error, double definition + @Test public void test9_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2513,6 +2679,7 @@ public void test9_1s1() throws Exception { // stat(ps); //call stat() // // ... // } + @Test public void test9_1s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2526,6 +2693,7 @@ public void test9_1s2a() throws Exception { // struct s { char* p; }; // define local struct s // struct s; // redeclaration, has no effect // } + @Test public void test9_1s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2539,6 +2707,7 @@ public void test9_1s2b() throws Exception { // // ... // friend Vector operator*(Matrix&, Vector&); // }; + @Test public void test9_1s2c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2549,11 +2718,13 @@ public void test9_1s2c() throws Exception { // struct s* p = new struct s; // global s // p->a = s; // local s // } + @Test public void test9_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // class A * A; + @Test public void test9_1s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2565,6 +2736,7 @@ public void test9_1s4() throws Exception { // tnode *right; // }; // tnode s, *sp; + @Test public void test9_2s11() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2575,6 +2747,7 @@ public void test9_2s11() throws Exception { // void f(T); // }; // void X::f(T t = count) { } + @Test public void test9_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2589,6 +2762,7 @@ public void test9_3s5() throws Exception { // fv S::* pmfv1 = &S::memfunc1; // fv S::* pmfv2 = &S::memfunc2; // fvc S::* pmfv3 = &S::memfunc3; + @Test public void test9_3s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2614,6 +2788,7 @@ public void test9_3s9() throws Exception { // n1.set("abc",&n2,0); // n2.set("def",0,0); // } + @Test public void test9_3_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2622,6 +2797,7 @@ public void test9_3_1s2() throws Exception { // void g() const; // void h() const volatile; // }; + @Test public void test9_3_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2633,6 +2809,7 @@ public void test9_3_1s3() throws Exception { // int h() const { return a++; } // error // }; // int s::f() const { return a; } + @Test public void test9_3_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2651,6 +2828,7 @@ public void test9_3_2s2() throws Exception { // y.f(); // y.g(); //error // } + @Test public void test9_3_2s4() throws Exception { String[] problems = { "g" }; final String code = getAboveComment(); @@ -2670,6 +2848,7 @@ public void test9_3_2s4() throws Exception { // process::reschedule(); // OK: no object necessary // g().reschedule(); // g() is called // } + @Test public void test9_4s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2682,6 +2861,7 @@ public void test9_4s2a() throws Exception { // static int i; // }; // int Y::i = g(); // equivalent to Y::g(); + @Test public void test9_4s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2692,6 +2872,7 @@ public void test9_4s2b() throws Exception { // }; // process* process::running = get_main(); // process* process::run_chain = running; + @Test public void test9_4_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2704,6 +2885,7 @@ public void test9_4_2s2() throws Exception { // p = "Jennifer"; // // ... // } + @Test public void test9_5s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2713,6 +2895,7 @@ public void test9_5s2() throws Exception { // aa = 1; // error // ptr->aa = 1; // OK // } + @Test public void test9_5s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2727,6 +2910,7 @@ public void test9_5s4() throws Exception { // if (a.b == t) // shall yield true // { } // } + @Test public void test9_6s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2754,6 +2938,7 @@ public void test9_6s4() throws Exception { // }; // }; // inner* p = 0; // error: inner not in scope + @Test public void test9_7s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2767,6 +2952,7 @@ public void test9_7s1() throws Exception { // }; // int enclose::inner::x = 1; // void enclose::inner::f(int i) { } + @Test public void test9_7s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2777,6 +2963,7 @@ public void test9_7s2() throws Exception { // class I1 {}; // definition of nested class // }; // class E::I2 {}; // definition of nested class + @Test public void test9_7s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2796,6 +2983,7 @@ public void test9_7s3() throws Exception { // // ... // } // local* p = 0; // error: local not in scope + @Test public void test9_8s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2810,6 +2998,7 @@ public void test9_8s1() throws Exception { // Y c; // error // X::Y d; // OK // X::I e; // OK + @Test public void test9_9s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2826,6 +3015,7 @@ public void test9_9s1() throws Exception { // public: // int c; // }; + @Test public void test10s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2834,12 +3024,14 @@ public void test10s2() throws Exception { // class B { }; // class C { }; // class D : public A, public B, public C { }; + @Test public void test10_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // class X { }; // class Y : public X, public X { }; // illformed + @Test public void test10_1s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2850,6 +3042,7 @@ public void test10_1s3a() throws Exception { // class C : public A, public B { void f(); }; // wellformed // class D : public A, public L { void f(); }; // wellformed // + @Test public void test10_1s3b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2883,6 +3076,7 @@ public void test10_1s3b() throws Exception { // pc->h(); //OK // pc->h(1); //OK // } + @Test public void test10_2s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2895,6 +3089,7 @@ public void test10_2s3a() throws Exception { // i; //finds U::i in two ways: as W::i and U::i in V // // no ambiguity because U::i is static // } + @Test public void test10_2s3b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2910,6 +3105,7 @@ public void test10_2s3b() throws Exception { // class C : public A, public B { // int f() { return A::f() + B::f(); } // }; + @Test public void test10_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2932,6 +3128,7 @@ public void test10_2s4() throws Exception { // e; // OK: only one e (enumerator) // pd->a++; //error, ambiguous: two as in D // } + @Test public void test10_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -2946,6 +3143,7 @@ public void test10_2s5() throws Exception { // }; // class C : public virtual V, public W { }; // class D : public B, public C { void glorp(); }; + @Test public void test10_2s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2962,6 +3160,7 @@ public void test10_2s6() throws Exception { // A* pa = &d; // error, ambiguous: C's A or B's A? // V* pv = &d; // OK: only one V subobject // } + @Test public void test10_2s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -2980,6 +3179,7 @@ public void test10_2s7() throws Exception { // c.f(); //calls B::f, the final overrider // c.C::f(); //calls A::f because of the usingdeclaration // } + @Test public void test10_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3021,6 +3221,7 @@ public void test10_3s2() throws Exception { // // convert the result to B* // dp->vf2(); //illformed: argument mismatch // } + @Test public void test10_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3046,6 +3247,7 @@ public void test10_3s5() throws Exception { // ap->f(); //calls D::B1::f // dp->f(); //illformed: ambiguous // } + @Test public void test10_3s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3064,6 +3266,7 @@ public void test10_3s9() throws Exception { // struct Okay : VB1, VB2 { // void f(); // }; + @Test public void test10_3s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3077,6 +3280,7 @@ public void test10_3s10() throws Exception { // VB1a* vb1ap = new Da; // vb1ap->f(); //calls VB2::f // } + @Test public void test10_3s11() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3084,6 +3288,7 @@ public void test10_3s11() throws Exception { // class B { public: virtual void f(); }; // class D : public B { public: void f(); }; // void D::f() { B::f(); } + @Test public void test10_3s12() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3099,6 +3304,7 @@ public void test10_3s12() throws Exception { // virtual void draw() = 0; // pure virtual // // ... // }; + @Test public void test10_4s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3117,6 +3323,7 @@ public void test10_4s2a() throws Exception { // shape f(); // error // void g(shape); // error // shape& h(shape&); // OK + @Test public void test10_4s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3127,6 +3334,7 @@ public void test10_4s3() throws Exception { // void rotate(int) {} // // ab_circle::draw() is a pure virtual // }; + @Test public void test10_4s4a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3137,6 +3345,7 @@ public void test10_4s4a() throws Exception { // void rotate(int) {} // void draw(); // a definition is required somewhere // }; + @Test public void test10_4s4b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3147,6 +3356,7 @@ public void test10_4s4b() throws Exception { // struct S { // int a; // S::a is public by default // }; + @Test public void test11s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3162,6 +3372,7 @@ public void test11s2() throws Exception { // A::BB x; // OK, typedef name A::BB is public // A::B y; // access error, A::B is private // } + @Test public void test11s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3176,6 +3387,7 @@ public void test11s3() throws Exception { // A::I g(A::I p = A::x); // A::I g(A::I p) { return 0; } // A::I A::x = 0; + @Test public void test11s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3186,6 +3398,7 @@ public void test11s5() throws Exception { // }; // }; // int D::E::m = 1; // OK, no access error on private E + @Test public void test11s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3196,6 +3409,7 @@ public void test11s6() throws Exception { // int b; // X::b is public // int c; // X::c is public // }; + @Test public void test11_1s1a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3209,6 +3423,7 @@ public void test11_1s1a() throws Exception { // public: // int d; // S::d is public // }; + @Test public void test11s1b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3218,6 +3433,7 @@ public void test11s1b() throws Exception { // private: // class A { }; // error: cannot change access // }; + @Test public void test11_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3231,6 +3447,7 @@ public void test11_1s3() throws Exception { // struct D6 : B { }; // B public by default // class D7 : protected B { }; // struct D8 : protected B { }; + @Test public void test11_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3256,6 +3473,7 @@ public void test11_2s2() throws Exception { // B* bp2 = (B*)this; // OK with cast // bp2->mi = 3; // OK: access through a pointer to B. // } + @Test public void test11_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3271,6 +3489,7 @@ public void test11_2s3() throws Exception { // p->i = 1; // OK: B* can be implicitly cast to A*, // // and f has access to i in A // } + @Test public void test11_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3289,6 +3508,7 @@ public void test11_2s4() throws Exception { // friend_set(&obj,10); // obj.member_set(10); // } + @Test public void test11_4s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3306,6 +3526,7 @@ public void test11_4s1() throws Exception { // // to declare members of nested class of X // }; // }; + @Test public void test11_4s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3320,6 +3541,7 @@ public void test11_4s2a() throws Exception { // class Z { // int v[X::a]; // error: X::a is private // }; + @Test public void test11_4s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3328,6 +3550,7 @@ public void test11_4s2b() throws Exception { // friend char* X::foo(int); // // ... // }; + @Test public void test11_4s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3336,6 +3559,7 @@ public void test11_4s4() throws Exception { // friend void f() { } // definition of global f, a friend of M, // // not the definition of a member function // }; + @Test public void test11_4s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3361,6 +3585,7 @@ public void test11_4s5() throws Exception { // // despite being derived from a friend // } // }; + @Test public void test11_4s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3381,6 +3606,7 @@ public void test11_4s8() throws Exception { // X *px; // OK, but ::X is found // Z *pz; // error, no Z is found // } + @Test public void test11_4s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3425,6 +3651,7 @@ public void test11_4s9() throws Exception { // p1->i = 2; // illformed // p2->i = 3; // illformed // } + @Test public void test11_5s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3446,6 +3673,7 @@ public void test11_5s1() throws Exception { // // D::f() is invoked // pd->f(); //error: D::f() is private // } + @Test public void test11_6s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3456,6 +3684,7 @@ public void test11_6s1() throws Exception { // class C : public A, public B { // void f() { W::f(); } // OK // }; + @Test public void test11_7s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3476,6 +3705,7 @@ public void test11_7s1() throws Exception { // return p->y; // error: I::y is private // } // }; + @Test public void test11_8s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3491,6 +3721,7 @@ public void test11_8s1() throws Exception { // C::B *t; // error, C::B is inaccessible // }; // }; + @Test public void test11_8s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3500,6 +3731,7 @@ public void test11_8s2() throws Exception { // C(); //declares the constructor // }; // C::C() { } // defines the constructor + @Test public void test12_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3518,6 +3750,7 @@ public void test12_1s1() throws Exception { // << '\ // '; // } + @Test public void test12_1s15() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3537,6 +3770,7 @@ public void test12_1s15() throws Exception { // X b = f(X(2)); // a = f(a); // } + @Test public void test12_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3552,6 +3786,7 @@ public void test12_2s2() throws Exception { // C obj1; // const C& cr = C(16)+C(23); // C obj2; + @Test public void test12_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3570,6 +3805,7 @@ public void test12_2s5() throws Exception { // int b = a; // error: // // a.operator X().operator int() not tried // int c = X(a); // OK: a.operator X().operator int() + @Test public void test12_3s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3591,6 +3827,7 @@ public void test12_3s4() throws Exception { // // ... // } // } + @Test public void test12_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3608,6 +3845,7 @@ public void test12_3s5() throws Exception { // a = 2; // a = X(2) // f(3); // f(X(3)) // } + @Test public void test12_3_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3625,6 +3863,7 @@ public void test12_3_1s1() throws Exception { // Z* p = new Z(1); // OK: direct initialization syntax used // Z a4 = (Z)1; // OK: explicit cast used // Z a5 = static_cast(1); // OK: explicit cast used + @Test public void test12_3_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3640,6 +3879,7 @@ public void test12_3_1s2() throws Exception { // i = (int)a; // i = a; // } + @Test public void test12_3_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3651,6 +3891,7 @@ public void test12_3_2s2() throws Exception { // if (a) { // ... // } // } + @Test public void test12_3_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3671,6 +3912,7 @@ public void test12_3_2s3() throws Exception { // B_ptr->B_alias::~B(); //4 // calls B's destructor // B_ptr->B_alias::~B_alias(); //5 // calls B's destructor // } + @Test public void test12_4s12() throws Exception { final String code = getAboveComment(); parse(code, ParserLanguage.CPP, false, 0); @@ -3703,6 +3945,7 @@ public void test12_4s12() throws Exception { // f(p); // p->X::~X(); //cleanup // } + @Test public void test12_4s13() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3720,6 +3963,7 @@ public void test12_4s13() throws Exception { // new D1[i]; // calls ::operator new[](size_t) // new D1; // illformed: ::operator new(size_t) hidden // } + @Test public void test12_5s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3734,6 +3978,7 @@ public void test12_5s2() throws Exception { // void operator delete(void*, size_t); // void operator delete[](void*); // }; + @Test public void test12_5s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3763,6 +4008,7 @@ public void test12_5s6() throws Exception { // // copy it into f // complex g = { 1, 2 }; // error; constructor is required // } + @Test public void test12_6_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3782,6 +4028,7 @@ public void test12_6_1s1() throws Exception { // float f; // complex c; // } x = { 99, 88.8, 77.7 }; + @Test public void test12_6_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3791,6 +4038,7 @@ public void test12_6_1s2() throws Exception { // struct B { }; // struct C: public A, public B { C(); }; // C::C(): global_A() { } // meminitializer for base A + @Test public void test12_6_2s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3799,6 +4047,7 @@ public void test12_6_2s2a() throws Exception { // struct B: public virtual A { }; // struct C: public A, public B { C(); }; // C::C(): A() { } // illformed: which A? + @Test public void test12_6_2s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -3813,6 +4062,7 @@ public void test12_6_2s2b() throws Exception { // D::D(int a) : B2(a+1), B1(a+2), c(a+3), b(a+4) // { } // D d(10); + @Test public void test12_6_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3848,6 +4098,7 @@ public void test12_6_2s3() throws Exception { // A a(2); // use V(int) // B b(3); // use V() // C c(4); // use V() + @Test public void test12_6_2s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3861,6 +4112,7 @@ public void test12_6_2s6() throws Exception { // const int& r; // X(int i): r(a), b(i), i(i), j(this->i) {} // }; + @Test public void test12_6_2s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3888,6 +4140,7 @@ public void test12_6_2s7() throws Exception { // // but base C not yet initialized // i(f()) {} // welldefined: bases are all initialized // }; + @Test public void test12_6_2s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3905,6 +4158,7 @@ public void test12_6_2s8() throws Exception { // extern X xobj; // int* p3 = &xobj.i; // OK, X is a POD class // X xobj; + @Test public void test12_7s1_a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3917,6 +4171,7 @@ public void test12_7s1_a() throws Exception { // Y() : p(&x.j) // undefined, x is not yet constructed // { } // }; + @Test public void test12_7s1_b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3947,6 +4202,7 @@ public void test12_7s1_b() throws Exception { // v->g(); // v is base of B, the call is welldefined, calls B::g // a->f(); //undefined behavior, a's type not a base of B // } + @Test public void test12_7s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3974,6 +4230,7 @@ public void test12_7s3() throws Exception { // dynamic_cast(a); // undefined behavior, // // a has type A*, A not a base of B // } + @Test public void test12_7s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3987,6 +4244,7 @@ public void test12_7s6() throws Exception { // X a(1); // calls X(int); // X b(a, 0); // calls X(const X&, int); // X c = b; // calls X(const X&, int); + @Test public void test12_8s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -3997,6 +4255,7 @@ public void test12_8s2a() throws Exception { // X(const X&); // X(X&); //OK // }; + @Test public void test12_8s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4007,6 +4266,7 @@ public void test12_8s2b() throws Exception { // }; // const X cx; // X x = cx; // error - X::X(X&) cannot copy cx into x + @Test public void test12_8s2c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4018,6 +4278,7 @@ public void test12_8s2c() throws Exception { // void g() { // S a( f() ); // does not instantiate member template // } + @Test public void test12_8s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4026,6 +4287,7 @@ public void test12_8s3() throws Exception { // void h(int (*)()); // redeclaration of h(int()) // void h(int x()) { } // definition of h(int()) // void h(int (*x)()) { } // illformed: redefinition of h(int()) + @Test public void test12_8s3d() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 1); } @@ -4033,6 +4295,7 @@ public void test12_8s3d() throws Exception { // struct X { // X(const X&, int); // }; + @Test public void test12_8s4a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4041,6 +4304,7 @@ public void test12_8s4a() throws Exception { // X(const X&, int); // }; // X::X(const X& x, int i =0) { } + @Test public void test12_8s4b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4055,6 +4319,7 @@ public void test12_8s4b() throws Exception { // x = cx; // error: // // X::operator=(X&) cannot assign cx into x // } + @Test public void test12_8s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4063,6 +4328,7 @@ public void test12_8s9() throws Exception { // struct A : virtual V { }; // struct B : virtual V { }; // struct C : B, A { }; + @Test public void test12_8s13() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4080,6 +4346,7 @@ public void test12_8s13() throws Exception { // return t; // } // Thing t2 = f(); + @Test public void test12_8s15() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4090,6 +4357,7 @@ public void test12_8s15() throws Exception { // abs(1); //call abs(int); // abs(1.0); //call abs(double); // } + @Test public void test13s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4103,6 +4371,7 @@ public void test13s2() throws Exception { // void g() const; // OK: no static g // void g() const volatile; // OK: no static g // }; + @Test public void test12_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4112,6 +4381,7 @@ public void test12_1s2() throws Exception { // void f(Int i); // OK: redeclaration of f(int) // void f(int i) { } // void f(Int i) { } // error: redefinition of f(int) + @Test public void test12_1s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 1); } @@ -4119,6 +4389,7 @@ public void test12_1s3a() throws Exception { // enum E { a }; // void f(int i) { } // void f(E i) { } + @Test public void test12_1s3b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4131,6 +4402,7 @@ public void test12_1s3b() throws Exception { // int g(char[5][10]); // same as g(char(*)[10]); // int g(char[7][10]); // same as g(char(*)[10]); // int g(char(*)[20]); // different from g(char(*)[10]); + @Test public void test12_1s3c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4140,6 +4412,7 @@ public void test12_1s3c() throws Exception { // int f (const int); // redeclaration of f(int) // int f (int) { } // definition of f(int) // int f (cInt) { } // error: redefinition of f(int) + @Test public void test12_8s3e() throws Exception { String[] problems = { "f" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -4155,6 +4428,7 @@ public void test12_8s3e() throws Exception { // f (1); // OK: call f(int, int) // f (); // Error: f(int, int) or f()? // } + @Test public void test12_8s3f() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4167,6 +4441,7 @@ public void test12_8s3f() throws Exception { // public: // int f(char*); // }; + @Test public void test13_2s1a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4186,6 +4461,7 @@ public void test13_2s1a() throws Exception { // pd->B::f(1); //OK // pd->f("Ben"); //OK, calls D::f // } + @Test public void test13_2s1b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4205,6 +4481,7 @@ public void test13_2s1b() throws Exception { // callee(88, 99); // error: only callee(int) in scope // } // } + @Test public void test13_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4220,6 +4497,7 @@ public void test13_2s2() throws Exception { // buffer(int s) { p = new char[size = s]; } // // ... // }; + @Test public void test13_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4235,6 +4513,7 @@ public void test13_2s3() throws Exception { // // ... // }; // T a = 1; // illformed: T(C(1)) not tried + @Test public void test13_3_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4249,6 +4528,7 @@ public void test13_3_1s6() throws Exception { // } a; // int i = a(1); // Calls f1 via pointer returned from // // conversion function + @Test public void test13_3_1_1_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4268,6 +4548,7 @@ public void test13_3_1_1_2s4() throws Exception { // // user defined types exist which // // would perform the operation. // } + @Test public void test13_3_1_2s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4280,6 +4561,7 @@ public void test13_3_1_2s1() throws Exception { // A a, b; // a + b; // operator+(a,b) chosen over int(a) + int(b) // } + @Test public void test13_3_1_2s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4294,6 +4576,7 @@ public void test13_3_1_2s6() throws Exception { // // a conversion to int // float x = a; // ambiguous: both possibilities require conversions, // // and neither is better than the other + @Test public void test13_3_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4313,6 +4596,7 @@ public void test13_3_3s1() throws Exception { // // &i -> int* is better than &i -> const int* // // and c -> int is better than c -> short // } + @Test public void test13_3_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4326,6 +4610,7 @@ public void test13_3_3s3() throws Exception { // B b; // f(b); //ambiguous because b -> C via constructor and // // b -> A via constructor or conversion function. + @Test public void test13_3_3_1_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4336,6 +4621,7 @@ public void test13_3_3_1_1s2() throws Exception { // int f(B&); // int i = f(b); // Calls f(B&), an exact match, rather than // // f(A&), a conversion + @Test public void test13_3_3_1_4s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4344,6 +4630,7 @@ public void test13_3_3_1_4s1() throws Exception { // int f(int *); // int i; // int j = f(&i); // Calls f(int *) + @Test public void test13_3_3_2s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4365,6 +4652,7 @@ public void test13_3_3_2s3a() throws Exception { // a.f(); //CallsX::f() const // b.f(); //Calls X::f() // } + @Test public void test13_3_3_2s3b() throws Exception { String[] problems = { "g" }; parse(getAboveComment(), ParserLanguage.CPP, problems); @@ -4377,6 +4665,7 @@ public void test13_3_3_2s3b() throws Exception { // int f(float); // int i = f(a); // Calls f(int), because short -> int is // // better than short -> float. + @Test public void test13_3_3_2s3c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4388,6 +4677,7 @@ public void test13_3_3_2s3c() throws Exception { // int f(A *); // int f(B *); // int i = f(pc); // Calls f(B *) + @Test public void test13_3_3_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4401,6 +4691,7 @@ public void test13_3_3_2s4() throws Exception { // int (*p3)(long) = &X::f; // OK // int (X::*p4)(long) = &X::f; // error: mismatch // int (*p6)(long) = &(X::f); // OK + @Test public void test13_4s5b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4414,6 +4705,7 @@ public void test13_4s5b() throws Exception { // complex z = a.operator+(b); // complex z = a+b; // void* p = operator new(sizeof(int)*n); // } + @Test public void test13_5s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4437,6 +4729,7 @@ public void test13_5s4() throws Exception { // dobj1 = dobj2; // calls implicitlydeclared // // D::operator=(const D&) // } + @Test public void test13_5_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4459,6 +4752,7 @@ public void test13_5_3s2() throws Exception { // operator++(b); //explicit call: like ++b; // operator++(b, 0); // explicit call: like b++; // } + @Test public void test13_5_7s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4472,6 +4766,7 @@ public void test13_5_7s1() throws Exception { // int& ri = i; // error: nonconst reference bound to temporary // const int& cri = i; // OK: const reference bound to temporary // } + @Test public void test14_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4479,6 +4774,7 @@ public void test14_1s6() throws Exception { // template class X; // error // template class Y; // OK // template class Z; // OK + @Test public void test14_1s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4491,40 +4787,47 @@ public void test14_1s7() throws Exception { // int v[5]; // R y; // OK due to implicit argument conversion // S z; // OK due to both adjustment and conversion + @Test public void test14_1s8() throws Exception { // TODO raised bug 90668 parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template class A; // template class A; + @Test public void test14_1s10a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template class A; + @Test public void test14_1s10b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template class B; // error + @Test public void test14_1s11() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template class X; // template class X { }; // error + @Test public void test14_1s12() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template class X { }; // template void f(T* p = new T); + @Test public void test14_1s13() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template 4) > // OK // class Y { }; + @Test public void test14_1s15() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4535,6 +4838,7 @@ public void test14_1s15() throws Exception { // Y< X<1> > x3; // OK // // with C++0x this is no longer valid: // // Y> 1> > x4; // OK: Y< X< (6>>1) > > + @Test public void test14_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4555,6 +4859,7 @@ public void test14_2s3() throws Exception { // T::template adjust<100>(); // // OK: < starts explicit qualification // } + @Test public void test14_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4579,6 +4884,7 @@ public void test14_2s4() throws Exception { // v1[3] = 7; // v2[3] = v3.elem(4) = dcomplex(7,8); // } + @Test public void test14_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4594,6 +4900,7 @@ public void test14_3s1() throws Exception { // // OK: even though Y::S is private // }; // X y; // error: S not accessible + @Test public void test14_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4605,6 +4912,7 @@ public void test14_3s3() throws Exception { // p->A::~A(); // OK: destructor call // q->A::~A(); // OK: destructor call // } + @Test public void test14_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4616,6 +4924,7 @@ public void test14_3s5() throws Exception { // X x3; // error: local type used as templateargument // X x4; // error: pointer to local type used as templateargument // } + @Test public void test14_3_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4626,6 +4935,7 @@ public void test14_3_1s2() throws Exception { // typedef int function(); // A a; // illformed: would declare A::t // // as a static member function + @Test public void test14_3_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4644,6 +4954,7 @@ public void test14_3_1s3() throws Exception { // // so c.y.x has type int // // V within C uses the partial specialization, // // so c.z.x has type long + @Test public void test14_3_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4651,6 +4962,7 @@ public void test14_3_3s2() throws Exception { // template class buffer { }; // buffer x; // buffer y; + @Test public void test14_2s1a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4660,6 +4972,7 @@ public void test14_2s1a() throws Exception { // list x2; // list x3; // list x4; + @Test public void test14_4s1b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4673,6 +4986,7 @@ public void test14_4s1b() throws Exception { // T& elem(int i) { return v[i]; } // // ... // }; + @Test public void test14_5_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4682,6 +4996,7 @@ public void test14_5_1s2() throws Exception { // void f2(); // }; // template void A::f1() { } // OK + @Test public void test14_5_1s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4701,6 +5016,7 @@ public void test14_5_1s3a() throws Exception { // if (i<0 || sz<=i) error("Array: range error"); // return v[i]; // } + @Test public void test14_5_1_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4711,6 +5027,7 @@ public void test14_5_1_1s1() throws Exception { // v1[3] = 7; // Array::operator[]() // v2[3] = dcomplex(7,8); // Array::operator[]() // } + @Test public void test14_5_1_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4721,6 +5038,7 @@ public void test14_5_1_1s2() throws Exception { // A::B* b1; // OK: requires A to be defined but not A::B // template class A::B { }; // A::B b2; // OK: requires A::B to be defined + @Test public void test14_5_1_2s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4735,6 +5053,7 @@ public void test14_5_1_2s1() throws Exception { // { // // ... // } + @Test public void test14_5_2s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4747,6 +5066,7 @@ public void test14_5_2s1() throws Exception { // void f(int i) { f<>(i); } // overriding function that calls // // the template instantiation // }; + @Test public void test14_5_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4764,6 +5084,7 @@ public void test14_5_2s4() throws Exception { // ip = a.operator int*(); // explicit call to template operator // // A::operator int*() // } + @Test public void test14_5_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4772,6 +5093,7 @@ public void test14_5_2s5() throws Exception { // static T s; // }; // template T X::s = 0; + @Test public void test14_5_1_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4788,6 +5110,7 @@ public void test14_5_1_3s1() throws Exception { // template friend class frd; // // ... // }; + @Test public void test14_5_4s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4807,6 +5130,7 @@ public void test14_5_4s1() throws Exception { // }; // } // } + @Test public void test14_5_4s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -4815,6 +5139,7 @@ public void test14_5_4s2() throws Exception { // template friend class B; // OK // template friend void f(T){ } // OK // }; + @Test public void test14_5_4s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4825,6 +5150,7 @@ public void test14_5_4s3() throws Exception { // }; // template struct A { X::Y ab; }; // OK // template struct A { X::Y ab; }; // OK + @Test public void test14_5_4s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4837,6 +5163,7 @@ public void test14_5_4s4() throws Exception { // template friend struct A::B; // template friend void A::f(); // }; + @Test public void test14_5_4s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4849,6 +5176,7 @@ public void test14_5_4s6() throws Exception { // A::B abcip; // uses #2 // A::B absip; // uses #3 // A::B abci; // uses #1 + @Test public void test14_5_5_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4858,12 +5186,14 @@ public void test14_5_5_3s2() throws Exception { // template class A { }; // #3 // template class A { }; // #4 // template class A { }; // #5 + @Test public void test14_5_5s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template struct B {}; // template struct B {}; // OK + @Test public void test14_5_5s9b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4877,6 +5207,7 @@ public void test14_5_5s9b() throws Exception { // A a2; // uses #2, T is int, I is 1 // A a3; // uses #4, T is char // A a4; // uses #5, T1 is int, T2 is char, I is 1 + @Test public void test14_5_5_1s2a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4887,6 +5218,7 @@ public void test14_5_5_1s2a() throws Exception { // template class A { }; // #4 // template class A { }; // #5 // A a5; // ambiguous: matches #3 and #5 : expect problem + @Test public void test14_5_5_1s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 1); } @@ -4896,6 +5228,7 @@ public void test14_5_5_1s2b() throws Exception { // template class X { }; // #2 // template void f(X); // #A // template void f(X); // #B + @Test public void test14_5_5_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4927,12 +5260,14 @@ public void test14_5_5_2s2() throws Exception { // a2.f(); //illformed, no definition of f for A // // the primary template is not used here // } + @Test public void test14_5_5_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } // template class Array { }; // template void sort(Array&); + @Test public void test14_5_6s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4944,6 +5279,7 @@ public void test14_5_6s1() throws Exception { // f(p); // call // // f(int*) // } + @Test public void test14_5_6_1s1a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4955,6 +5291,7 @@ public void test14_5_6_1s1a() throws Exception { // f(p); // call // // f(int*) // } + @Test public void test14_5_6_1s1b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -4965,6 +5302,7 @@ public void test14_5_6_1s1b() throws Exception { // template void f/*2*/(A, A); // // Guaranteed to be different // template void f/*3*/(A, A); + @Test public void test14_5_6_1s8a() throws Exception { final String content = getAboveComment(); IASTTranslationUnit tu = parse(content, ParserLanguage.CPP, true, 0); @@ -4979,6 +5317,7 @@ public void test14_5_6_1s8a() throws Exception { // // Illformed, no diagnostic required // template void f(A, A); // template void f(A, A); + @Test public void test14_5_6_1s8b() throws Exception { //test is only for syntax, semantics are not checked here. parse(getAboveComment(), ParserLanguage.CPP, false, 0); @@ -4996,6 +5335,7 @@ public void test14_5_6_1s8b() throws Exception { // B b; // b * a; // calls #1a // } + @Test public void test14_5_6_2s3() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5024,6 +5364,7 @@ public void test14_5_6_2s3() throws Exception { // const A z2; // h(z2); // h(const T&) is called because h(A&) is not callable // } + @Test public void test14_5_6_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5037,6 +5378,7 @@ public void test14_5_6_2s5() throws Exception { // f(ip); //calls #2 // g(ip); //calls #4 // } + @Test public void test14_5_6_2s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5061,6 +5403,7 @@ public void test14_5_6_2s6() throws Exception { // // no visible declarations of B and a8 // } // }; + @Test public void test14_6s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5073,6 +5416,7 @@ public void test14_6s2() throws Exception { // typename T::X x; // illformed: finds the data member X // // not the member type X // } + @Test public void test14_6s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5083,6 +5427,7 @@ public void test14_6s4() throws Exception { // void f(A::B); // illformed: typename required before A::B // typename A::B g(); // OK // }; + @Test public void test14_6s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5104,6 +5449,7 @@ public void test14_6s6() throws Exception { // // not instantiated // } // }; + @Test public void test14_6s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5124,6 +5470,7 @@ public void test14_6s7() throws Exception { // } // // ... // }; + @Test public void test14_6s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5145,12 +5492,14 @@ public void test14_6s8() throws Exception { // // by two calls of f(int) // g('a'); //will cause three calls of f(char) // } + @Test public void test14_6s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } // template class X { }; // template void f(T* p = new T); + @Test public void test14_6_1s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5160,6 +5509,7 @@ public void test14_6_1s3a() throws Exception { // X* p2; // X* p3; // }; + @Test public void test14_6_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5169,6 +5519,7 @@ public void test14_6_1s1() throws Exception { // Y* p; // meaning Y // Y* q; // meaning Y // }; + @Test public void test14_6_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5176,6 +5527,7 @@ public void test14_6_1s2() throws Exception { // template class Array {}; // template class X : public Array { }; // template class Y : public T { }; + @Test public void test14_6_1s3b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5187,6 +5539,7 @@ public void test14_6_1s3b() throws Exception { // } // }; // template class X; // error: templateparameter redeclared + @Test public void test14_6_1s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5198,6 +5551,7 @@ public void test14_6_1s4() throws Exception { // template void A::f() { // B b; // A's B, not the template parameter // } + @Test public void test14_6_1s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5211,6 +5565,7 @@ public void test14_6_1s5() throws Exception { // template void N::B::f(C) { // C b; // C is the template parameter, not N::C // } + @Test public void test14_6_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5224,6 +5579,7 @@ public void test14_6_1s6() throws Exception { // B b; // A's B // a b; // error: A's a isn't a type name // }; + @Test public void test14_6_1s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5236,6 +5592,7 @@ public void test14_6_1s7() throws Exception { // pb->j++; // } // }; + @Test public void test14_6_2s2() throws Exception { final String code = getAboveComment(); parse(code, ParserLanguage.CPP, true, 0); @@ -5253,6 +5610,7 @@ public void test14_6_2s2() throws Exception { // template struct X : B { // A a; // a has type double // }; + @Test public void test14_6_2s3() throws Exception { final String content = getAboveComment(); IASTTranslationUnit tu = parse(content, ParserLanguage.CPP, true, 0); @@ -5278,6 +5636,7 @@ public void test14_6_2s3() throws Exception { // Y* p; // Y // }; // Y ya; + @Test public void test14_6_2s4() throws Exception { final String content = getAboveComment(); parse(content, ParserLanguage.CPP, true, 0); @@ -5302,6 +5661,7 @@ public void test14_6_2s4() throws Exception { // }; // void g(int); // not in scope at the point of the template // // definition, not considered for the call g(1) + @Test public void test14_6_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5321,6 +5681,7 @@ public void test14_6_3s1() throws Exception { // // in its namespace (global scope) // b = gcd(3,4); // illformed; gcd is not visible // } + @Test public void test14_6_5s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5332,6 +5693,7 @@ public void test14_6_5s2() throws Exception { // template T X::s = 0; // X aa; // X bb; + @Test public void test14_7s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5352,6 +5714,7 @@ public void test14_7s6() throws Exception { // p->g(); //instantiation of class Z required, and // // instantiation of Z::g() required // } + @Test public void test14_7_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5367,12 +5730,14 @@ public void test14_7_1s3() throws Exception { // // convert D* to B* // delete ppp; // instantiation of D required // } + @Test public void test14_7_1s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // template class X; // X ch; // error: definition of X required + @Test public void test14_7_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5391,6 +5756,7 @@ public void test14_7_1s6() throws Exception { // static int x; // }; // template<> int B<>::x = 1; // specialize for T == int + @Test public void test14_7s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5405,6 +5771,7 @@ public void test14_7s3() throws Exception { // f(sr); //instantiation of S allowed but not required // // instantiation of S allowed but not required // }; + @Test public void test14_7_1s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5426,6 +5793,7 @@ public void test14_7_1s5() throws Exception { // int i = m.get("Nicholas"); // // ... // } + @Test public void test14_7_1s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5438,6 +5806,7 @@ public void test14_7_1s10() throws Exception { // f(a, b); // default argument z = zdef(T()) instantiated // f(a); //illformed; ydef is not declared // } + @Test public void test14_7_1s12() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5448,6 +5817,7 @@ public void test14_7_1s12() throws Exception { // // the implicit instantiation of X which requires // // the implicit instantiation of X which ... // }; + @Test public void test14_7_1s14() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5461,6 +5831,7 @@ public void test14_7_1s14() throws Exception { // template void f(T&) { } // } // template void N::f(int&); + @Test public void test14_7_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5475,6 +5846,7 @@ public void test14_7_2s2() throws Exception { // template class N::Y; // OK: explicit instantiation in namespace N // template void N::Y::mf(); // OK: explicit instantiation // // in namespace N + @Test public void test14_7_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5483,6 +5855,7 @@ public void test14_7_2s5() throws Exception { // template void sort(Array& v); // // instantiate sort(Array&) - templateargument deduced // template void sort<>(Array&); + @Test public void test14_7_2s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5490,6 +5863,7 @@ public void test14_7_2s6() throws Exception { // char* p = 0; // template T g(T = &p); // template int g(int); // OK even though &p isn't an int. + @Test public void test14_7_2s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5499,6 +5873,7 @@ public void test14_7_2s9() throws Exception { // template class Array { }; // template void sort(Array& v) { } // template<> void sort(Array&) ; + @Test public void test14_7_3s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5506,6 +5881,7 @@ public void test14_7_3s1() throws Exception { // template<> class X { }; // error: X not a template // template class X; // template<> class X { }; // OK: X is a template + @Test public void test14_7_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5524,6 +5900,7 @@ public void test14_7_3s3() throws Exception { // // explicit specialization syntax not used for a member of // // explicitly specialized class template specialization // void A::f(int) { } + @Test public void test14_7_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5538,6 +5915,7 @@ public void test14_7_3s5() throws Exception { // template<> void sort(Array& v); // error: specialization // // after use of primary template // template<> void sort<>(Array& v); // OK: sort not yet used + @Test public void test14_7_3s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5552,6 +5930,7 @@ public void test14_7_3s6() throws Exception { // } // template<> class N::Y { }; // OK: specialization // // in same namespace + @Test public void test14_7_3s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5561,6 +5940,7 @@ public void test14_7_3s9() throws Exception { // // explicit specialization for sort(Array&) // // with deduces templateargument of type int // template<> void sort(Array&); + @Test public void test14_7_3s11() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5572,6 +5952,7 @@ public void test14_7_3s11() throws Exception { // }; // template<> template<> class A::B { }; // template<> template<> void A::B::mf() { }; + @Test public void test14_7_3s17() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5580,6 +5961,7 @@ public void test14_7_3s17() throws Exception { // template<> class X; // X* p; // OK: pointer to declared class X // X x; // error: object of incomplete class X + @Test public void test14_7_3s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5589,6 +5971,7 @@ public void test14_7_3s10() throws Exception { // template <> void f(int*); // Ambiguous // template <> void f(int*); // OK // template <> void f(int); // OK + @Test public void test14_7_3s12() throws Exception { // gcc does not report the explicit instantiation as ambiguous, so we accept it as well. parse(getAboveComment(), ParserLanguage.CPP, true, 0); @@ -5598,6 +5981,7 @@ public void test14_7_3s12() throws Exception { // template inline T g(T) { } // template<> inline void f<>(int) { } // OK: inline // template<> int g<>(int) { } // OK: not inline + @Test public void test14_7_3s14() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5620,6 +6004,7 @@ public void test14_7_3s14() throws Exception { // void A::g(int,char); // X specified as char // // member specialization even if defined in class definition // template<> void A::h(int) { } + @Test public void test14_7_3s16() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5637,6 +6022,7 @@ public void test14_7_3s16() throws Exception { // template template<> // void A::B::mf2() { }; // illformed; B is specialized but // // its enclosing class template A is not + @Test public void test14_7_3s18() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5651,6 +6037,7 @@ public void test14_7_3s18() throws Exception { // f(&a); //call f(int*) // f(&b); //call f(char**) // } + @Test public void test14_8s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5667,6 +6054,7 @@ public void test14_8s2() throws Exception { // int i = convert(d); // int convert(double) // char c = convert(d); // char convert(double) // } + @Test public void test14_8_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5677,6 +6065,7 @@ public void test14_8_1s1() throws Exception { // int i = f(5.6); // Y is deduced to be double // int j = f(5.6); // illformed: X cannot be deduced // } + @Test public void test14_8_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5690,6 +6079,7 @@ public void test14_8_1s2() throws Exception { // // Z is deduced to be double // f("aa",3.0); //error: X cannot be deduced // } + @Test public void test14_8_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5703,6 +6093,7 @@ public void test14_8_1s3() throws Exception { // { // f(1); // OK, means f(Complex(1)) // } + @Test public void test14_8_1s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5723,6 +6114,7 @@ public void test14_8_1s4() throws Exception { // f<3>(b); //wellformed because C::f is visible; then // // A::f is found by argument dependent lookup // } + @Test public void test14_8_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5737,6 +6129,7 @@ public void test14_8_1s6() throws Exception { // int i = convert(d); // call convert(double) // int c = convert(d); // call convert(double) // } + @Test public void test14_8_2s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5757,6 +6150,7 @@ public void test14_8_2s1() throws Exception { // // #5: function type is h(int, const int*) // h(1,0); // } + @Test public void test14_8_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5770,6 +6164,7 @@ public void test14_8_2s3() throws Exception { // f(); // f(0,0) // f(); // f(0,0) // } + @Test public void test14_8_2s5() throws Exception { final String content = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(content, true); @@ -5793,6 +6188,7 @@ public void test14_8_2s5() throws Exception { // X f(Y, Y); // #2 // X x1, x2; // X x3 = f(x1, x2); // deduction fails on #1 (cannot add X+X), calls #2 + @Test public void test14_8_2s8a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -5809,6 +6205,7 @@ public void _test14_8_2s8b() throws Exception { // template int f(typename T::B*); // int i = f(0); + @Test public void test14_8_2s8c() throws Exception { final String content = getAboveComment(); IASTTranslationUnit tu = parse(content, ParserLanguage.CPP, true, 2); @@ -5837,6 +6234,7 @@ public void test14_8_2s8c() throws Exception { // g(0); // The N member of C is not a non-type // h(0); // The TT member of D is not a template // } + @Test public void test14_8_2s8d() throws Exception { final String content = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(content, true); @@ -5848,6 +6246,7 @@ public void test14_8_2s8d() throws Exception { // template int f(int T::*); // int i = f(0); + @Test public void test14_8_2s8e() throws Exception { final String code = getAboveComment(); parse(code, ParserLanguage.CPP, true, 2); @@ -5859,6 +6258,7 @@ public void test14_8_2s8e() throws Exception { // template int f(S*); // struct X {}; // int i0 = f(0); + @Test public void test14_8_2s8f() throws Exception { final String code = getAboveComment(); parse(code, ParserLanguage.CPP, true, 2); @@ -5868,6 +6268,7 @@ public void test14_8_2s8f() throws Exception { // template int f(int); // int i2 = f(0); // can't conv 1 to int* + @Test public void test14_8_2s8g() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 1); } @@ -5876,6 +6277,7 @@ public void test14_8_2s8g() throws Exception { // template int f(int); // int i1 = f<1>(0); // ambiguous // int i2 = f<1000>(0); // ambiguous + @Test public void test14_8_2s9() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 2); } @@ -5890,6 +6292,7 @@ public void test14_8_2s9() throws Exception { // f({1,"asdf"}); // error: T deduced to both int and const char* // g({1,2,3}); // error: no argument deduced for T // } + @Test public void test14_8_2_1s1a() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5908,6 +6311,7 @@ public void test14_8_2_1s1a() throws Exception { // f(x, y, z); // Types is deduced to int, float, const int // g(x, y, z); // T1 is deduced to int; Types is deduced to float, int // } + @Test public void test14_8_2_1s1b() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5926,6 +6330,7 @@ public void test14_8_2_1s1b() throws Exception { // int n2 = f(0); // calls f(int&&) // int n3 = g(i); // error: would call g(const int&&), which // // would bind an rvalue reference to an lvalue + @Test public void test14_8_2_1s3() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5943,6 +6348,7 @@ public void test14_8_2_1s3() throws Exception { // int g(int); // int g(char); // int i = f(g); // calls f(int (*)(int)) + @Test public void test14_8_2_1s7() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5957,6 +6363,7 @@ public void test14_8_2_1s7() throws Exception { // int g(int); // char g(char); // int i = f(1, g); // calls f(int, int (*)(int)) + @Test public void test14_8_2_1s8() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5971,6 +6378,7 @@ public void test14_8_2_1s8() throws Exception { // char g(char); // template T g(T); // int i = f(1, g); // calls f(int, int (*)(int)) + @Test public void test14_8_2_1s9() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5986,6 +6394,7 @@ public void test14_8_2_1s9() throws Exception { // void test(const int * const * const * p1) { // test(a); // T is deduced as int, not const int // } + @Test public void test14_8_2_3s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -5995,6 +6404,7 @@ public void test14_8_2_3s7() throws Exception { // void g() { // f(1); // calls #1 // } + @Test public void test14_8_2_4s11() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6009,6 +6419,7 @@ public void test14_8_2_4s11() throws Exception { // g(Tuple()); // calls #3 // g(Tuple()); // calls #3 // } + @Test public void test14_8_2_4s12() throws Exception { final String code = getAboveComment(); parse(code, ParserLanguage.CPP, true, 0); @@ -6032,6 +6443,7 @@ public void test14_8_2_4s12() throws Exception { // void test() { // g({1,2,3}); // error: no argument deduced for T // } + @Test public void test14_8_2_5s5() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6048,6 +6460,7 @@ public void test14_8_2_5s5() throws Exception { // f(a,a); //OK: T is A // f(b,b); //OK: T is B // } + @Test public void test14_8_2_5s7a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6062,6 +6475,7 @@ public void test14_8_2_5s7a() throws Exception { // f(g2); //error: T could be char or int // f(g3); //error: U could be char or float // } + @Test public void test14_8_2_5s7b() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6078,6 +6492,7 @@ public void test14_8_2_5s7b() throws Exception { // { // f(p); // f(const int *) // } + @Test public void test14_8_2_5s7c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6093,6 +6508,7 @@ public void test14_8_2_5s7c() throws Exception { // f(d); //calls f(B&) // f(d2); //calls f(B&) // } + @Test public void test14_8_2_5s7d() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6104,6 +6520,7 @@ public void test14_8_2_5s7d() throws Exception { // f(i); // calls f(int&), i.e., #1 // f(0); // calls f(int&&), i.e., #2 // } + @Test public void test14_8_2_5s10() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6120,6 +6537,7 @@ public void test14_8_2_5s10() throws Exception { // f(v); //error: argument for templateparameter // //T cannot be deduced // } + @Test public void test14_8_2_5s14() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6138,6 +6556,7 @@ public void test14_8_2_5s14() throws Exception { // f2<10>(v); //OK // f3(v); //OK: i deduced to be 10 // } + @Test public void test14_8_2_5s15() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6163,6 +6582,7 @@ public void test14_8_2_5s15() throws Exception { // g<0>(a1); // OK // f(a1, a2); // OK // } + @Test public void test14_8_2_5s16a() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6193,6 +6613,7 @@ public void test14_8_2_5s16a() throws Exception { // B<77> b; // deduce<77> (a.xm, 62, b.ym); // } + @Test public void test14_8_2_5s16b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6210,6 +6631,7 @@ public void test14_8_2_5s16b() throws Exception { // B<1> b; // g(b); // OK: cv-qualifiers are ignored on template parameter types // } + @Test public void test14_8_2_5s17() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6232,6 +6654,7 @@ public void test14_8_2_5s17() throws Exception { // f(&h); // OK: void h(char,int) is a unique match // f(&foo); // error: type deduction fails because foo is a template // } + @Test public void test14_8_2_5s18() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6248,6 +6671,7 @@ public void test14_8_2_5s18() throws Exception { // f(); // error: cannot deduce T // f(); // OK: call f(5,7) // } + @Test public void test14_8_2_5s19() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6266,6 +6690,7 @@ public void test14_8_2_5s19() throws Exception { // A ab; // f(ab); //calls f(A) // } + @Test public void test14_8_2_4s20() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6283,6 +6708,7 @@ public void test14_8_2_4s20() throws Exception { // Y y2; // uses partial specialization; T is int&, Types contains float, double // Y y3; // uses primary template; Types contains int, float, double // int fv = f(g); // OK; Types contains int, float + @Test public void test14_8_2_4s21() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6296,6 +6722,7 @@ public void test14_8_2_4s21() throws Exception { // f(1, 2); // calls #3; non-variadic template #3 is more // // specialized than the variadic templates #1 and #2 // } + @Test public void test14_8_2_5s22() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6319,6 +6746,7 @@ public void test14_8_2_5s22() throws Exception { // char m2 = max(c,d); // max(char a, char b) // int m3 = max(a,c); // error: cannot generate max(int,char) // } + @Test public void test14_8_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6331,6 +6759,7 @@ public void test14_8_3s2() throws Exception { // char m2 = max(c,d); // max(char a, char b) // int m3 = max(a,c); // resolved // } + @Test public void test14_8_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6343,6 +6772,7 @@ public void test14_8_3s3() throws Exception { // f(bi); // f(bi) // f(di); // f( (B&)di ) // } + @Test public void test14_8_3s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6356,6 +6786,7 @@ public void test14_8_3s4() throws Exception { // f(i,c); //#2: f(i,c); // f(i,i); //#2: f(i,char(i)) // } + @Test public void test14_8_3s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6364,6 +6795,7 @@ public void test14_8_3s5() throws Exception { // void g() { // f("Annemarie"); // call of f // } + @Test public void test14_8_3s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6380,6 +6812,7 @@ public void test14_8_3s6() throws Exception { // } catch(...) { // handler 1 // } // } + @Test public void test15s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6402,6 +6835,7 @@ public void test15s2() throws Exception { // // handles exceptions thrown from the ctorinitializer // // and from the constructor function body // } + @Test public void test15s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6426,6 +6860,7 @@ public void test15s3() throws Exception { // // handle exceptions of type Overflow here // } // } + @Test public void test15_1s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6440,6 +6875,7 @@ public void test15_1s1() throws Exception { // // other handler // } // } + @Test public void test15_1s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6459,6 +6895,7 @@ public void test15_1s6() throws Exception { // // ... // } // } + @Test public void test15_3s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6466,11 +6903,13 @@ public void test15_3s4() throws Exception { // void f() throw(int); // OK // void (*fp)() throw (int); // OK // void g(void pfa() throw(int)); // OK + @Test public void test15_4s1a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // typedef int (*pf)() throw(int); // illformed + @Test public void test15_4s1b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6486,6 +6925,7 @@ public void test15_4s1b() throws Exception { // f(a); // g(a); // } + @Test public void test15_4s1c() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6498,6 +6938,7 @@ public void test15_4s1c() throws Exception { // void f(); // illformed // void g() throw (int); // OK // }; + @Test public void test15_4s3a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6510,6 +6951,7 @@ public void test15_4s3a() throws Exception { // pf1 = pf2; // OK: pf1 is less restrictive // pf2 = pf1; // error: pf2 is more restrictive // } + @Test public void test15_4s3b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6525,6 +6967,7 @@ public void test15_4s3b() throws Exception { // if (n) throw Z(); // also OK // throw W(); // will call unexpected() // } + @Test public void test15_4s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6534,6 +6977,7 @@ public void test15_4s8() throws Exception { // { // // f(); //OK // } + @Test public void test15_4s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6553,6 +6997,7 @@ public void test15_4s10() throws Exception { // // Implicit declaration of D::D(const D&) throw(); // // Implicit declaration of D::~D() throw (X,Y); // }; + @Test public void test15_4s13() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6564,6 +7009,7 @@ public void test15_4s13() throws Exception { // #else // #define INCFILE "versN.h" // #endif + @Test public void test16_2s8() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6578,6 +7024,7 @@ public void test16_2s8() throws Exception { // a = ((a + 32765) + b); // a = (a + (b + 32765)); // } + @Test public void test18_2_1_5s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6586,6 +7033,7 @@ public void test18_2_1_5s2() throws Exception { // enum E { z = 16 }; // int b[X::z]; // OK // }; + @Test public void test3_3_1s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6598,6 +7046,7 @@ public void test3_3_1s4() throws Exception { // f(a); // } // }; + @Test public void test3_4_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6616,6 +7065,7 @@ public void test3_4_1s3() throws Exception { // F f; // f.A::a = 1; // OK, A::a is a member of F // } + @Test public void test3_4_5s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6626,6 +7076,7 @@ public void test3_4_5s4() throws Exception { // // may be statically initialized to 0.0 or // // dynamically initialized to 1.0 // double d1 = fd(); // may be initialized statically to 1.0 + @Test public void test3_6_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6637,6 +7088,7 @@ public void test3_6_2s2() throws Exception { // *pcc = &c; // *pc = 'C'; //2: modifies a const object // } + @Test public void test4_4s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6649,6 +7101,7 @@ public void test4_4s4() throws Exception { // int S::* pm = &S::i; // pm refers to mutable member S::i // cs.*pm = 88; // illformed: cs is a const object // } + @Test public void test5_5s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6670,6 +7123,7 @@ public void test5_5s5() throws Exception { // g(); //okay: name g refers to the same entity // h(); //error: name h found in two namespaces // } + @Test public void test7_3_4s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6677,6 +7131,7 @@ public void test7_3_4s4() throws Exception { // int a; // const int b = a; // int c = b; + @Test public void test8_5s14() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6690,6 +7145,7 @@ public void test8_5s14() throws Exception { // struct D2 : D { // void f(); // }; + @Test public void test10_3s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6706,6 +7162,7 @@ public void test10_3s3() throws Exception { // B* bp = new D; // delete bp; //1: uses D::operator delete(void*) // } + @Test public void test12_5s7a() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6724,6 +7181,7 @@ public void test12_5s7a() throws Exception { // B* bp = new D[i]; // delete[] bp; // undefined behavior // } + @Test public void test12_5s7b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6739,6 +7197,7 @@ public void test12_5s7b() throws Exception { // //operator+ (a,a); // ERROR - global operator hidden by member // a + a; // OK - calls global operator+ // } + @Test public void test13_3_1_2s10() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6750,6 +7209,7 @@ public void test13_3_1_2s10() throws Exception { // C value; // // ... // }; + @Test public void test14_1s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6761,6 +7221,7 @@ public void test14_1s2() throws Exception { // T t1 = i; // templateparameters T and i // ::T t2 = ::i; // global namespace members T and i // } + @Test public void test14_1s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6772,6 +7233,7 @@ public void test14_1s3() throws Exception { // X<&s.m> x4; // error: address of nonstatic member // X<&s.s> x5; // error: &S::s must be used // X<&S::s> x6; // OK: address of static member + @Test public void test14_3_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6784,6 +7246,7 @@ public void test14_3_2s3() throws Exception { // X x1; // error: string literal as template argument // char p[] = "Vivisectionist"; // X x2; // OK + @Test public void test14_3_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6792,6 +7255,7 @@ public void test14_3_2s2() throws Exception { // B<1> b2; // error: temporary would be required for template argument // int c = 1; // B b1; // OK + @Test public void test14_3_2s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6810,6 +7274,7 @@ public void test14_3_2s4() throws Exception { // void f(int); // template struct A { }; // A<&f> a; // selects f(int) + @Test public void test14_3_2s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6827,11 +7292,13 @@ public void test14_3_2s5() throws Exception { // ac.f('c'); //template // ac.f<>(1); //template // } + @Test public void test14_5_2s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); //should be 0 } // template class A { }; // error + @Test public void test14_5_5s5() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -6845,6 +7312,7 @@ public void test14_5_5s5() throws Exception { // template template // struct A::C::B { }; // A::C::B absip; // uses partial specialization + @Test public void test14_5_5s6() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6858,6 +7326,7 @@ public void test14_5_5s6() throws Exception { // } // A a; // uses the partial specialization, which is found through // // the using declaration which refers to the primary template + @Test public void test14_5_5s7() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6865,6 +7334,7 @@ public void test14_5_5s7() throws Exception { // template void f(); // template void f(); // OK: overloads the first template // // distinguishable with an explicit template argument list + @Test public void test14_5_6_1s4() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6873,6 +7343,7 @@ public void test14_5_6_1s4() throws Exception { // template A f/*1*/(A, A); // #1 // template A f/*2*/(A, A); // same as #1 // template A f/*3*/(A, A); // different from #1 + @Test public void test14_5_6_1s5() throws Exception { final String content = getAboveComment(); IASTTranslationUnit tu = parse(content, ParserLanguage.CPP, true, 0); @@ -6887,6 +7358,7 @@ public void test14_5_6_1s5() throws Exception { // template class A; // template void f/*1*/(A); // #1 // template void f/*2*/(A); // same as #1 + @Test public void test14_5_6_1s6() throws Exception { final String content = getAboveComment(); IASTTranslationUnit tu = parse(content, ParserLanguage.CPP, true, 0); @@ -6900,12 +7372,14 @@ public void test14_5_6_1s6() throws Exception { // int f(int); // #2 // int k = f(1); // uses #2 // int l = f<>(1); // uses #1 + @Test public void test14_8_1s2b() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } // #define TABSIZE 100 // int table[TABSIZE]; + @Test public void test15_3_5s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6924,6 +7398,7 @@ public void test15_3_5s3() throws Exception { // int (&ra)[3] = a; // ra refers to the array a // ra[1] = i; // modifies a[1] // } + @Test public void test8_5_3s1() throws Exception { // TODO raised bug 90648 parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6936,6 +7411,7 @@ public void test8_5_3s1() throws Exception { // TODO raised bug 90648 // this->A::operator=(s); // wellformed // return *this; // } + @Test public void test12s1() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6957,6 +7433,7 @@ public void test12s1() throws Exception { // // C/B/D/A sublattice is fully constructed // { } // }; + @Test public void test12_7s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6979,6 +7456,7 @@ public void test12_7s2() throws Exception { // class D { // typedef I I; // error, even though no reordering involved // }; + @Test public void test3_3_6s5() throws Exception { // 90606 parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -6993,6 +7471,7 @@ public void test3_3_6s5() throws Exception { // 90606 // void g() { // (int (*)(int))&f; // cast expression as selector // } + @Test public void test13_4s5a() throws Exception { // bug 90674 parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -7028,6 +7507,7 @@ public void test13_4s5a() throws Exception { // bug 90674 // }; // int ef(D&); // int ff(X&); + @Test public void test11_3s2() throws Exception { //bug 92793 IASTTranslationUnit tu = parse(getAboveComment(), ParserLanguage.CPP, true, 0); IASTCompositeTypeSpecifier D = getCompositeType(tu, 2); @@ -7041,6 +7521,7 @@ public void test11_3s2() throws Exception { //bug 92793 // int b = f(a); // int c(b); // } + @Test public void test8_5s2() throws Exception { // 90641 parse(getAboveComment(), ParserLanguage.CPP, true, 0); } @@ -7053,6 +7534,7 @@ public void test8_5s2() throws Exception { // 90641 // new (int(*p)) int; // newplacement expression // new (int(*[x])); // new typeid // } + @Test public void test8_2s3() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, false, 0); } @@ -7063,6 +7545,7 @@ public void test8_2s3() throws Exception { // { // f(); // int() is a typeid:call the first f() // } + @Test public void test14_3s2() throws Exception { parse(getAboveComment(), ParserLanguage.CPP, true, 0); } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTestBase.java index 53eaee20412..623341d6704 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTestBase.java @@ -18,12 +18,6 @@ import org.eclipse.cdt.internal.core.parser.ParserException; public abstract class AST2CPPTestBase extends AST2TestBase { - public AST2CPPTestBase() { - } - - public AST2CPPTestBase(String name) { - super(name); - } protected IASTTranslationUnit parseAndCheckBindings(String code) throws Exception { return parseAndCheckBindings(code, ScannerKind.STD); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index 97ae091bb2a..c2d7e7ce9f2 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -25,7 +25,14 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.XVALUE; import static org.eclipse.cdt.core.parser.ParserLanguage.CPP; import static org.eclipse.cdt.core.parser.tests.VisibilityAsserts.assertVisibility; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.BufferedReader; import java.io.StringReader; @@ -170,22 +177,11 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor; import org.eclipse.cdt.internal.core.index.IndexCPPSignatureUtil; import org.eclipse.cdt.internal.core.parser.ParserException; - -import junit.framework.TestSuite; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class AST2CPPTests extends AST2CPPTestBase { - public AST2CPPTests() { - } - - public AST2CPPTests(String name) { - super(name); - } - - public static TestSuite suite() { - return suite(AST2CPPTests.class); - } - private void assertProblemBinding(int id, IBinding b) { assertTrue(b instanceof IProblemBinding); assertEquals(id, ((IProblemBinding) b).getID()); @@ -242,15 +238,15 @@ private void checkDeclDef(String[] declNames, String[] defNames, IASTDeclaration final String name = dtor.getName().toString(); switch (dtor.getRoleForName(dtor.getName())) { case IASTNameOwner.r_declaration: - assertTrue("Unexpected decl " + name, i < declNames.length); + assertTrue(i < declNames.length, "Unexpected decl " + name); assertEquals(declNames[i++], name); break; case IASTNameOwner.r_definition: - assertTrue("Unexpected decl " + name, j < defNames.length); + assertTrue(j < defNames.length, "Unexpected decl " + name); assertEquals(defNames[j++], name); break; default: - assertTrue(name, false); + assertTrue(false, name); } } } @@ -261,8 +257,8 @@ private void checkDeclDef(String[] declNames, String[] defNames, IASTDeclaration protected static void assertSameType(IType first, IType second) { assertNotNull(first); assertNotNull(second); - assertTrue("Expected types to be the same, but first was: '" + first.toString() + "' and second was: '" + second - + "'", first.isSameType(second)); + assertTrue(first.isSameType(second), "Expected types to be the same, but first was: '" + first.toString() + + "' and second was: '" + second + "'"); } private void checkUserDefinedLiteralIsType(String code, String type_name) throws Exception { @@ -284,6 +280,7 @@ private void checkUserDefinedLiteralIsRet(String code) throws Exception { // int (*zzz2) (char); // int ((*zzz3)) (char); // int (*(zzz4)) (char); + @Test public void testBug40768() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -291,6 +288,7 @@ public void testBug40768() throws Exception { assertNoProblemBindings(col); } + @Test public void testBug40422() throws Exception { IASTTranslationUnit tu = parse("class A { int y; }; int A::* x = 0;", CPP); NameCollector col = new NameCollector(); @@ -298,6 +296,7 @@ public void testBug40422() throws Exception { assertNoProblemBindings(col); } + @Test public void testBug43241() throws Exception { parseAndCheckBindings("int m(int); int (*pm)(int) = &m; int f(){} int f(int); int x = f((*pm)(5));"); } @@ -308,6 +307,7 @@ public void testBug43241() throws Exception { // int f(){} // int f(int); // int x = f((a.*pm)(5)); + @Test public void testBug43242() throws Exception { parseAndCheckBindings(getAboveComment()); } @@ -320,14 +320,17 @@ public void testBug43242() throws Exception { // int f(){} // int f(int); // int x = f(a->*pm); + @Test public void testBug43579() throws Exception { parseAndCheckBindings(); } + @Test public void testBug75189() throws Exception { parseAndCheckBindings("struct A{};typedef int (*F) (A*);"); } + @Test public void testBug75340() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings("void f(int i = 0, int * p = 0);"); IASTSimpleDeclaration sd = (IASTSimpleDeclaration) tu.getDeclarations()[0]; @@ -339,6 +342,7 @@ public void testBug75340() throws Exception { // if (first < 1 || last > 99) // return false; // } + @Test public void testBug75858() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -351,6 +355,7 @@ public void testBug75858() throws Exception { // type c; // enum type2 {A, B}; // enum type2 d, e; + @Test public void testBug77967() throws Exception { parseAndCheckBindings(); } @@ -365,6 +370,7 @@ public void testBug77967() throws Exception { // p2 = &MyStruct.b; // MyStruct.b = 1; // } + @Test public void testBug78103() throws Exception { parseAndCheckBindings(getAboveComment()); } @@ -378,6 +384,7 @@ public void testBug78103() throws Exception { // A(int t); // }; // A::A(int t) : B(t - 1) {} + @Test public void testBug78883() throws Exception { parseAndCheckBindings(); } @@ -388,10 +395,12 @@ public void testBug78883() throws Exception { // B(); // void foo(); // }; + @Test public void testBug79540() throws Exception { parseAndCheckBindings(getAboveComment()); } + @Test public void testBug86282() throws Exception { IASTTranslationUnit tu = parse("void foo() { int (* f[])() = new (int (*[10])()); }", CPP); NameCollector col = new NameCollector(); @@ -412,6 +421,7 @@ public void testBug86282() throws Exception { // for(int x = 0 ; x < 10; x++) { // } // } + @Test public void testBug95411() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector nameCol = new NameCollector(); @@ -419,6 +429,7 @@ public void testBug95411() throws Exception { assertNoProblemBindings(nameCol); } + @Test public void testBug95424() throws Exception { IASTTranslationUnit tu = parse("void f(){ traits_type::copy(__r->_M_refdata(), __buf, __i); }", CPP, ScannerKind.GNU, true); @@ -435,6 +446,7 @@ public void testBug95424() throws Exception { // CINIT(FILE, OBJECTPOINT, 1), // CINIT(URL, OBJECTPOINT, 2) // } CURLoption; + @Test public void testBug102825() throws Exception { parseAndCheckBindings(getAboveComment()); } @@ -447,6 +459,7 @@ public void testBug102825() throws Exception { // WithTemplate brokenInstance; // return 0; // } + @Test public void testBug103578() throws Exception { parseAndCheckBindings(getAboveComment()); } @@ -462,11 +475,13 @@ public void testBug103578() throws Exception { // struct A::B { // typedef typename A::type type; // }; + @Test public void testBug433556() throws Exception { parseAndCheckBindings(); } // class A { } a; + @Test public void testSimpleClass() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTSimpleDeclaration decl = (IASTSimpleDeclaration) tu.getDeclarations()[0]; @@ -485,6 +500,7 @@ public void testSimpleClass() throws Exception { } // class A; class A {}; + @Test public void testClassForwardDecl() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -506,6 +522,7 @@ public void testClassForwardDecl() throws Exception { } // class A {}; A a; + @Test public void testVariable() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -532,6 +549,7 @@ public void testVariable() throws Exception { } // class A { int f; }; + @Test public void testField() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -553,6 +571,7 @@ public void testField() throws Exception { } // class A { int f(); }; + @Test public void testMethodDeclaration() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -575,6 +594,7 @@ public void testMethodDeclaration() throws Exception { // class A { void f(); }; // void A::f() { } + @Test public void testMethodDefinition() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -612,6 +632,7 @@ public void testMethodDefinition() throws Exception { // class A { void f(); int i; }; // void A::f() { i; } + @Test public void testMemberReference() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -663,6 +684,7 @@ public void testMemberReference() throws Exception { // class A { int i; }; // class B : public A { void f(); }; // void B::f() { i; } + @Test public void testBasicInheritance() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -733,6 +755,7 @@ public void testBasicInheritance() throws Exception { // void f(){ // BC::a++; //ok // } + @Test public void testNamespaces() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -760,6 +783,7 @@ public void testNamespaces() throws Exception { // A++; // class A a; // } + @Test public void testNameHiding() throws Exception { String content = getAboveComment(); IASTTranslationUnit tu = parse(content, CPP); @@ -792,6 +816,7 @@ public void testNameHiding() throws Exception { // B b; // } // int B; + @Test public void testBlockTraversal() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -818,6 +843,7 @@ public void testBlockTraversal() throws Exception { // f(1); //calls f(int); // f('b'); // } + @Test public void testFunctionResolution() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -836,6 +862,7 @@ public void testFunctionResolution() throws Exception { // S myS; // myS.x = 5; // } + @Test public void testSimpleStruct() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -858,6 +885,7 @@ public void testSimpleStruct() throws Exception { // struct A; // struct A * a; // } + @Test public void testStructureTags_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -879,6 +907,7 @@ public void testStructureTags_a() throws Exception { // void f(){ // struct A * a; // } + @Test public void testStructureTags_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -901,6 +930,7 @@ public void testStructureTags_b() throws Exception { // void f() { // a->i; // } + @Test public void testStructureDef() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -919,6 +949,7 @@ public void testStructureDef() throws Exception { // void f(int x) { // struct x i; // } + @Test public void testStructureNamespace() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -933,6 +964,7 @@ public void testStructureNamespace() throws Exception { // void f(int b){ // b; // } + @Test public void testFunctionDef() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -954,6 +986,7 @@ public void testFunctionDef() throws Exception { // f(); // } // void f(){ } + @Test public void testSimpleFunctionCall() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -971,6 +1004,7 @@ public void testSimpleFunctionCall() throws Exception { // i; // } // } + @Test public void testForLoop() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -985,6 +1019,7 @@ public void testForLoop() throws Exception { // void f(){ // ((struct A *) 1)->x; // } + @Test public void testExpressionFieldReference() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -1005,6 +1040,7 @@ public void testExpressionFieldReference() throws Exception { // if (*cp != red) // return; // } + @Test public void testEnumerations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -1029,6 +1065,7 @@ public void testEnumerations() throws Exception { assertSame(pt.getType(), hue); } + @Test public void testPointerToFunction() throws Exception { IASTTranslationUnit tu = parse("int (*pfi)();", CPP); NameCollector collector = new NameCollector(); @@ -1056,6 +1093,7 @@ public void testPointerToFunction() throws Exception { // int * f(int i, char c); // void (*g) (A *); // void (* (*h)(A**)) (int); + @Test public void testFunctionTypes() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -1121,6 +1159,7 @@ public void testFunctionTypes() throws Exception { assertTrue(h_ps[0] instanceof IBasicType); } + @Test public void testFnReturningPtrToFn() throws Exception { IASTTranslationUnit tu = parse("void (* f(int))(){}", CPP); @@ -1145,6 +1184,7 @@ public void testFnReturningPtrToFn() throws Exception { // X::f(); // X::g(); // } + @Test public void testUsingDeclaration() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -1182,6 +1222,7 @@ public void testUsingDeclaration() throws Exception { // using A::f; // f('c'); // } + @Test public void testUsingDeclaration_86368() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IFunction f1 = bh.assertNonProblem("f(int)", 1); @@ -1209,6 +1250,7 @@ public void testUsingDeclaration_86368() throws Exception { // void g(char []); // void h(int(a)()); // void h(int (*) ()); + @Test public void testFunctionDeclarations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -1233,6 +1275,7 @@ public void testFunctionDeclarations() throws Exception { // B * b = new B(); // b->x; // } + @Test public void testProblem_AmbiguousInParent() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -1250,6 +1293,7 @@ public void testProblem_AmbiguousInParent() throws Exception { // A * a = new A(); // a->x; // } + @Test public void testVirtualParentLookup() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(true); @@ -1279,6 +1323,7 @@ public void testVirtualParentLookup() throws Exception { // A * a = new A(); // a->x; // } + @Test public void testAmbiguousVirtualParentLookup() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(true); @@ -1310,6 +1355,7 @@ public void testAmbiguousVirtualParentLookup() throws Exception { // namespace A { // void f() { x; } // } + @Test public void testExtendedNamespaces() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -1327,6 +1373,7 @@ public void testExtendedNamespaces() throws Exception { } // class A { A(void); A(const A &); }; + @Test public void testConstructors() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -1350,6 +1397,7 @@ public void testConstructors() throws Exception { } // class A {}; + @Test public void testImplicitConstructors() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -1385,6 +1433,7 @@ public void testImplicitConstructors() throws Exception { // }; // typedef E F; // F::E() {} + @Test public void testImplicitConstructors_360223() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPClassType c = bh.assertNonProblem("C", 0); @@ -1407,6 +1456,7 @@ public void testImplicitConstructors_360223() throws Exception { // template // struct Bar { }; // constexpr int v = Bar::val; + @Test public void testImplicitConstructors_1265() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(true); @@ -1431,6 +1481,7 @@ public void testImplicitConstructors_1265() throws Exception { // int test() { // foo(1); // } + @Test public void testInheritedConstructor() throws Exception { parseAndCheckBindings(); } @@ -1449,6 +1500,7 @@ public void testInheritedConstructor() throws Exception { // int test() { // foo(1); // } + @Test public void testInheritedConstructorFromTemplateInstance() throws Exception { parseAndCheckBindings(); } @@ -1467,6 +1519,7 @@ public void testInheritedConstructorFromTemplateInstance() throws Exception { // int test() { // foo(1); // } + @Test public void testInheritedConstructorFromUnknownClass() throws Exception { parseAndCheckBindings(); } @@ -1488,6 +1541,7 @@ public void testInheritedConstructorFromUnknownClass() throws Exception { // void test(A a) { // foo(a); // } + @Test public void testInheritedTemplateConstructor() throws Exception { parseAndCheckBindings(); } @@ -1498,12 +1552,14 @@ public void testInheritedTemplateConstructor() throws Exception { // using base::base; // base waldo() const; // }; + @Test public void testInheritedConstructorShadowingBaseClassName_485383() throws Exception { parseAndCheckBindings(); } // class A { ~A(); }; // class B { ~B(void); }; + @Test public void testExplicitDestructor_183160() throws Exception { // class F { (~)F(); }; // class G { (~)G(void); }; @@ -1520,20 +1576,21 @@ public void testExplicitDestructor_183160() throws Exception { int count = 0; for (ICPPMethod method : methods) count += method.getName().startsWith("~") ? 1 : 0; - assertEquals(line, 0, count); + assertEquals((long) 0, (long) count, line); methods = A.getDeclaredMethods(); assertNotNull(methods); count = 0; for (ICPPMethod method : methods) count += method.getName().startsWith("~") ? 1 : 0; - assertEquals(line, 1, count); + assertEquals((long) 1, (long) count, line); } } // class C {}; // class D {D();}; // class E {E(void);}; + @Test public void testImplicitDestructor_183160() throws Exception { BufferedReader br = new BufferedReader(new StringReader(getAboveComment())); for (String line = br.readLine(); line != null; line = br.readLine()) { @@ -1547,14 +1604,14 @@ public void testImplicitDestructor_183160() throws Exception { int count = 0; for (ICPPMethod method : methods) count += method.getName().startsWith("~") ? 1 : 0; - assertEquals(line, 1, count); + assertEquals((long) 1, (long) count, line); methods = A.getDeclaredMethods(); assertNotNull(methods); count = 0; for (ICPPMethod method : methods) count += method.getName().startsWith("~") ? 1 : 0; - assertEquals(line, 0, count); + assertEquals((long) 0, (long) count, line); } } @@ -1578,6 +1635,7 @@ public void testImplicitDestructor_183160() throws Exception { // class R {public: R(int k=5, long k=4);}; // class S {public: S(int k=5, int* ip= 0);}; // class T {public: T(int k=5, int* ip= 0, T* t= 0);}; + @Test public void testExplicitDefaultConstructor_183160() throws Exception { BufferedReader br = new BufferedReader(new StringReader(getAboveComment())); for (String line = br.readLine(); line != null; line = br.readLine()) { @@ -1596,6 +1654,7 @@ public void testExplicitDefaultConstructor_183160() throws Exception { // class R {public: R(int k=5, long k);}; // class S {public: S(int k=5, int* ip);}; // class T {public: T(int k, int* ip= 0, T* t= 0);}; + @Test public void testExplicitNonDefaultConstructor_183160() throws Exception { BufferedReader br = new BufferedReader(new StringReader(getAboveComment())); for (String line = br.readLine(); line != null; line = br.readLine()) { @@ -1618,6 +1677,7 @@ public void testExplicitNonDefaultConstructor_183160() throws Exception { // class F {private: F(const F &, int j=2, int k=3);}; // class G {protected: G(volatile G &, int i=4, int l=2);}; // class H {H(const volatile H &, int i=1, long k=2) {}}; + @Test public void testExplicitCopyConstructor_183160() throws Exception { BufferedReader br = new BufferedReader(new StringReader(getAboveComment())); for (String line = br.readLine(); line != null; line = br.readLine()) { @@ -1638,6 +1698,7 @@ public void testExplicitCopyConstructor_183160() throws Exception { // class K {protected: K(volatile K *, int i=4, int l=2);}; // K * rather than K & // class L {L(const volatile L &, int i=1, long k=2, int* x) {}}; // param int* x has no initializer // class M {public: template M(){}}; // same signature as implicit + @Test public void testNotExplicitCopyConstructor_183160() throws Exception { BufferedReader br = new BufferedReader(new StringReader(getAboveComment())); for (String line = br.readLine(); line != null; line = br.readLine()) { @@ -1657,6 +1718,7 @@ public void testNotExplicitCopyConstructor_183160() throws Exception { // class B {public: void operator=(B &, int); }; // compile error // class C {public: void operator=(C &c, int k=5) {} }; // compile error // class D {public: void operator=(const D &, const D &); }; // compile error + @Test public void testNotExplicitCopyAssignmentOperator_183160() throws Exception { BufferedReader br = new BufferedReader(new StringReader(getAboveComment())); for (String line = br.readLine(); line != null; line = br.readLine()) { @@ -1690,6 +1752,7 @@ public void testNotExplicitCopyAssignmentOperator_183160() throws Exception { // class B {protected: void operator=(const B &); }; // class C {private: void operator=(volatile C &) {} }; // class D {D& operator=(volatile const D &); }; + @Test public void testExplicitCopyAssignmentOperator_183160() throws Exception { BufferedReader br = new BufferedReader(new StringReader(getAboveComment())); for (String line = br.readLine(); line != null; line = br.readLine()) { @@ -1725,6 +1788,7 @@ public void testExplicitCopyAssignmentOperator_183160() throws Exception { // }; // // A a = A(1); + @Test public void testConstructorCall() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPConstructor ctor = bh.assertNonProblem("A(int x)", "A", ICPPConstructor.class); @@ -1744,6 +1808,7 @@ public void testConstructorCall() throws Exception { // void test() { // A a("hi", 5, 10); // } + @Test public void testInvalidImplicitConstructorCall() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("a", 1, IProblemBinding.class); @@ -1779,6 +1844,7 @@ public void _testConversionOperator() throws Exception { // S s; // waldo(s); // ERROR // } + @Test public void testOverloadedRefQualifiedConversionOperators_506728() throws Exception { parseAndCheckBindings(); } @@ -1786,6 +1852,7 @@ public void testOverloadedRefQualifiedConversionOperators_506728() throws Except // namespace A { int x; } // namespace B = A; // int f(){ B::x; } + @Test public void testNamespaceAlias() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1803,6 +1870,7 @@ public void testNamespaceAlias() throws Exception { assertInstances(col, x, 3); } + // @Test // public void testBug84250() throws Exception { // assertTrue(((IASTDeclarationStatement) ((IASTCompoundStatement) // ((IASTFunctionDefinition) parse( @@ -1815,6 +1883,7 @@ public void testNamespaceAlias() throws Exception { // int (*p) [2]; // (&p)[0] = 1; // } + @Test public void testBug84250() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1834,6 +1903,7 @@ public void testBug84250() throws Exception { // int (*p) [2]; // (&p)[0] = 1; // } + @Test public void testBug84250b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1849,6 +1919,7 @@ public void testBug84250b() throws Exception { // struct s { double i; } f(void); // struct s f(void){} + @Test public void testBug84266() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1862,6 +1933,7 @@ public void testBug84266() throws Exception { assertSame(s_ref, s_decl); } + @Test public void testBug84266b() throws Exception { IASTTranslationUnit tu = parse("struct s f(void);", CPP); NameCollector col = new NameCollector(); @@ -1887,6 +1959,7 @@ public void testBug84266b() throws Exception { // int x; // { int x = x; } // } + @Test public void testBug84228() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1913,6 +1986,7 @@ public void testBug84228() throws Exception { // A::n = 42; // A b; // } + @Test public void testBug84615() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1931,6 +2005,7 @@ public void testBug84615() throws Exception { assertNotNull(prob); } + @Test public void testBug84371() throws Exception { String code = "int x = ::ABC::DEF::ghi;"; IASTTranslationUnit tu = parse(code, CPP); @@ -1953,6 +2028,7 @@ public void testBug84371() throws Exception { // AB::f(1); // AB::f(`c`); // } + @Test public void testBug84679() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.STD, false); NameCollector col = new NameCollector(); @@ -1982,6 +2058,7 @@ public void testBug84679() throws Exception { // struct Node * node; // friend struct Glob; // }; + @Test public void testBug84692() throws Exception { // also tests bug 234042. CPPASTNameBase.sAllowRecursionBindings = false; @@ -2004,6 +2081,7 @@ public void testBug84692() throws Exception { // namespace A { using namespace B; int a; } // namespace B { using namespace A; } // void f() { B::a++; } + @Test public void testBug84686() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2028,6 +2106,7 @@ public void testBug84686() throws Exception { // } // return *this; // } + @Test public void testBug84705() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2055,6 +2134,7 @@ public void testBug84705() throws Exception { // class A { void f(); void g() const; }; // void A::f(){ this; } // void A::g() const { *this; } + @Test public void testThis() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -2081,6 +2161,7 @@ public void testThis() throws Exception { assertTrue(((IQualifierType) type).isConst()); } + @Test public void testBug84710() throws Exception { IASTTranslationUnit tu = parse("class T { T(); };", CPP); NameCollector col = new NameCollector(); @@ -2098,6 +2179,7 @@ public void testBug84710() throws Exception { // int main() { // f(parm); // } + @Test public void testArgumentDependantLookup() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2126,6 +2208,7 @@ public void testArgumentDependantLookup() throws Exception { // int main() { // f(a); // } + @Test public void testArgumentDependantLookup_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2155,6 +2238,7 @@ public void testArgumentDependantLookup_b() throws Exception { // A::i; //i2 // j; // } + @Test public void testBug84610() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2181,6 +2265,7 @@ public void testBug84610() throws Exception { // B* pb = new B(); // pb->mutate(); // } + @Test public void testBug84703() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2201,6 +2286,7 @@ public void testBug84703() throws Exception { // void f() { ; // int S::* pm = &S::i; // } + @Test public void testBug84469() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2209,6 +2295,7 @@ public void testBug84469() throws Exception { assertEquals(9, col.size()); } + @Test public void testPointerToMemberType() throws Exception { IASTTranslationUnit tu = parse("struct S; int S::* pm;", CPP); NameCollector col = new NameCollector(); @@ -2232,6 +2319,7 @@ public void testPointerToMemberType() throws Exception { // void f() { // s->*pm = 1; // } + @Test public void testBug_PM_() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2251,6 +2339,7 @@ public void testBug_PM_() throws Exception { // void foo() { // (s->*pm)()->i; // } + @Test public void testBug_PM_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2276,7 +2365,9 @@ public void testBug_PM_b() throws Exception { assertInstances(col, f, 3); } + // @Test // public void testFindTypeBinding_a() throws Exception { + // IASTTranslationUnit tu = parse( // "int x = 5; int y(x);", CPP); // @@ -2298,6 +2389,7 @@ public void testBug_PM_b() throws Exception { // assertTrue(binding instanceof ICPPClassType); // } // + // @Test // public void testFindTypeBinding_b() throws Exception { // IASTTranslationUnit tu = parse( // "struct B; void f() { B * bp; }", CPP); @@ -2321,6 +2413,7 @@ public void testBug_PM_b() throws Exception { // void g() { // B * bp; //1 // } + @Test public void testBug85049() throws Exception { IASTTranslationUnit t = parse(getAboveComment(), CPP); IASTFunctionDefinition g = (IASTFunctionDefinition) t.getDeclarations()[1]; @@ -2335,6 +2428,7 @@ public void testBug85049() throws Exception { // int A::* pm = &A::i; // f(pm); // } + @Test public void testPMConversions() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2361,6 +2455,7 @@ public void testPMConversions() throws Exception { // void g() { // f(pm); // } + @Test public void testPMKoenig_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2387,6 +2482,7 @@ public void testPMKoenig_a() throws Exception { // N::A * a; // f(a->*pm); // } + @Test public void testPMKoenig_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2413,6 +2509,7 @@ public void testPMKoenig_b() throws Exception { // }; // void set(); // class B{}; + @Test public void testFriend() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2436,6 +2533,7 @@ public void testFriend() throws Exception { // friend B; // }; // class B{}; + @Test public void testForwardDeclaredFriend_525645() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -2453,6 +2551,7 @@ public void testForwardDeclaredFriend_525645() throws Exception { // friend void set(); // friend void Other::m(); // }; + @Test public void testFriend_275358() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -2473,6 +2572,7 @@ public void testFriend_275358() throws Exception { // class A { friend class B; friend class B; }; // class B{}; + @Test public void testBug59149() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2494,6 +2594,7 @@ public void testBug59149() throws Exception { // class B { // friend class A::N; // }; + @Test public void testBug59302() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2515,6 +2616,7 @@ public void testBug59302() throws Exception { // class A { // friend class B *helper(); // }; + @Test public void testBug75482() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2538,6 +2640,7 @@ public void testBug75482() throws Exception { // void foo() { // pf = &f; // } + @Test public void testBug45763a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2560,6 +2663,7 @@ public void testBug45763a() throws Exception { // g(&f); // (*pg)(&f); // } + @Test public void testBug45763b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2581,6 +2685,7 @@ public void testBug45763b() throws Exception { // void (* bar ()) (int) { // return &f; // } + @Test public void testBug45763c() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2600,6 +2705,7 @@ public void testBug45763c() throws Exception { // void foo () { // (void (*)(int)) &f; // } + @Test public void testBug45763d() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2617,6 +2723,7 @@ public void testBug45763d() throws Exception { // extern int g; // int g; // void f() { g = 1; } + @Test public void testBug85824() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2638,6 +2745,7 @@ public void testBug85824() throws Exception { // int a4; // a; // } + @Test public void testPrefixLookup() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2669,6 +2777,7 @@ public void testPrefixLookup() throws Exception { // void test(){ // v_; // } + @Test public void testAdditionalNamespaceLookup() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2689,6 +2798,7 @@ public void testAdditionalNamespaceLookup() throws Exception { // static void f(); // void f() {} + @Test public void testIsStatic() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2707,7 +2817,8 @@ public void testIsStatic() throws Exception { // // && __i == 2)) // // return; // // } - // public void testBug85310() throws Exception { + // @Test + // public void testBug85310() throws Exception { // IASTTranslationUnit tu = parse(getAboveComment(), CPP); // IASTFunctionDefinition f = (IASTFunctionDefinition) // tu.getDeclarations()[0]; @@ -2725,6 +2836,7 @@ public void testIsStatic() throws Exception { // void g() { // B* pb = new (p) D1; // } + @Test public void testBug86267() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(true); @@ -2755,6 +2867,7 @@ public void testBug86267() throws Exception { // } // return *this; // } + @Test public void testBug86269() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2782,6 +2895,7 @@ public void testBug86269() throws Exception { // printf(p); // printf("abc"); // } + @Test public void testBug86279() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2801,6 +2915,7 @@ public void testBug86279() throws Exception { // void h() { // g(a); // } + @Test public void testBug86346() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2813,6 +2928,7 @@ public void testBug86346() throws Exception { assertInstances(col, g, 2); } + @Test public void testBug86288() throws Exception { String code = "int *foo(int *b) { return (int *)(b); }"; IASTTranslationUnit tu = parse(code, CPP); @@ -2827,6 +2943,7 @@ public void testBug86288() throws Exception { // }; // int (B::*pb)() = &B::f; // } + @Test public void testBug84476() throws Exception { String code = getAboveComment(); IASTFunctionDefinition foo = (IASTFunctionDefinition) parse(code, CPP).getDeclarations()[0]; @@ -2845,6 +2962,7 @@ public void testBug84476() throws Exception { // } // A(int) {} // }; + @Test public void testBug86336() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPClassType clazz = bh.assertNonProblem("A {", "A", ICPPClassType.class); @@ -2864,6 +2982,7 @@ public void testBug86336() throws Exception { // void foo() { // int S::* pm = &S::i; // } + @Test public void testBug86306() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2889,6 +3008,7 @@ public void testBug86306() throws Exception { // using A::f; // illformed // using A::X; // illformed // }; + @Test public void testBug86372() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2902,6 +3022,7 @@ public void testBug86372() throws Exception { // a[i] = 1; // int j = i; // } + @Test public void testBug86319() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2925,6 +3046,7 @@ public void testBug86319() throws Exception { // p->x.i; // p->x.j; // } + @Test public void testBug86350() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2951,6 +3073,7 @@ public void testBug86350() throws Exception { // i = 0; // } // } + @Test public void testBug84478() throws Exception { IASTFunctionDefinition foo = (IASTFunctionDefinition) parse(getAboveComment(), CPP).getDeclarations()[0]; ICPPASTWhileStatement whileStatement = (ICPPASTWhileStatement) ((IASTCompoundStatement) foo.getBody()) @@ -2964,6 +3087,7 @@ public void testBug84478() throws Exception { // { enum { x = x }; } // } // enum { RED }; + @Test public void testBug86353() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2997,6 +3121,7 @@ public void testBug86353() throws Exception { // typeid(d1) == typeid(d2); // typeid(D) == typeid(d2); // } + @Test public void testBug86274() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3018,6 +3143,7 @@ public void testBug86274() throws Exception { // point(1); // point(); // } + @Test public void testBug86546() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3036,6 +3162,7 @@ public void testBug86546() throws Exception { // void g() { i++; } // } // } + @Test public void testBug86358a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3056,6 +3183,7 @@ public void testBug86358a() throws Exception { // namespace V { // } // } + @Test public void testBug86358b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3086,6 +3214,7 @@ public void testBug86358b() throws Exception { // void f(int) { f('c'); } // void g(int) { g('c'); } // }; + @Test public void test86371() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3118,6 +3247,7 @@ public void test86371() throws Exception { // namespace CWVLN = Company_with_veryblahblah; // namespace CWVLN = Company_with_veryblahblah; // namespace CWVLN = CWVLN; + @Test public void testBug86369() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3159,6 +3289,7 @@ public void testBug86369() throws Exception { // void f(int); // } // using A::f; + @Test public void testBug86470a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3198,6 +3329,7 @@ public void testBug86470a() throws Exception { // using B::f; // f('c'); // } + @Test public void testBug86470b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3217,6 +3349,7 @@ public void testBug86470b() throws Exception { // g('a'); // struct g gg; // } + @Test public void testBug86470c() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3251,6 +3384,7 @@ public void testBug86470c() throws Exception { // x = 1; // struct x xx; // } + @Test public void testBug86470d() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3290,6 +3424,7 @@ public void testBug86470d() throws Exception { // using A::f; // f(3.5); // } + @Test public void testBug86470e() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3320,6 +3455,7 @@ public void testBug86470e() throws Exception { // void f(B* p) { // p->i = 1; // } + @Test public void testBug86678() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3340,6 +3476,7 @@ public void testBug86678() throws Exception { // printf("hello"); // printf("a=%d b=%d", a, b); // } + @Test public void testBug86543() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3353,6 +3490,7 @@ public void testBug86543() throws Exception { // int m = (a > b) ? a : b; // return (m > c) ? m : c; // } + @Test public void testBug86554() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3377,6 +3515,7 @@ public void testBug86554() throws Exception { // struct X { static int g(); }; // struct Y : X { static int i ; }; // int Y::i = g(); + @Test public void testBug86621() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3414,6 +3553,7 @@ public void testBug86621() throws Exception { // y++; // g(); // } + @Test public void testBug86649() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3446,6 +3586,7 @@ public void testBug86649() throws Exception { // int c; // C() : c(0) { } // }; + @Test public void testBug86827() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3470,6 +3611,7 @@ public void testBug86827() throws Exception { // int v2; // } // } + @Test public void testFind_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3498,6 +3640,7 @@ public void testFind_a() throws Exception { // }; // void B::f() { // } + @Test public void testFind_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3530,6 +3673,7 @@ public void testFind_b() throws Exception { // void f(char); // using A::f; // } + @Test public void testFind_c() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3568,6 +3712,7 @@ public void testFind_c() throws Exception { // using namespace A; // using namespace C; // } + @Test public void testFind_d() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3596,6 +3741,7 @@ public void testFind_d() throws Exception { // B(); // void bf(); // }; + @Test public void testFind_185408() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3629,6 +3775,7 @@ public void testFind_185408() throws Exception { // int b; // void fb(); // }; + @Test public void testImplicitMethods() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3687,6 +3834,7 @@ public void testImplicitMethods() throws Exception { assertSame(result[9], A_implicit[3]); } + @Test public void testBug87424() throws Exception { IASTTranslationUnit tu = parse("int * __restrict x;", CPP, ScannerKind.GNU); NameCollector col = new NameCollector(); @@ -3707,6 +3855,7 @@ public void testBug87424() throws Exception { assertTrue(((ICPPPointerToMemberType) t).isRestrict()); } + @Test public void testBug87705() throws Exception { IASTTranslationUnit tu = parse("class A { friend class B::C; };", CPP, ScannerKind.GNU); NameCollector col = new NameCollector(); @@ -3718,6 +3867,7 @@ public void testBug87705() throws Exception { assertEquals(C.getID(), IProblemBinding.SEMANTIC_NAME_NOT_FOUND); } + @Test public void testBug88459() throws Exception { IASTTranslationUnit tu = parse("int f(); ", CPP); NameCollector col = new NameCollector(); @@ -3727,6 +3877,7 @@ public void testBug88459() throws Exception { assertFalse(f.isStatic()); } + @Test public void testBug88501a() throws Exception { IASTTranslationUnit tu = parse("void f(); void f(int); struct f;", CPP); NameCollector col = new NameCollector(); @@ -3737,7 +3888,9 @@ public void testBug88501a() throws Exception { assertTrue(col.getName(3).resolveBinding() instanceof ICPPClassType); } + // @Test // public void testBug8342a() throws Exception { + // IASTTranslationUnit tu = parse("int a; int a;", CPP); // // NameCollector col = new NameCollector(); @@ -3747,6 +3900,7 @@ public void testBug88501a() throws Exception { // IProblemBinding p = (IProblemBinding) col.getName(1).resolveBinding(); // assertEquals(p.getID(), IProblemBinding.SEMANTIC_INVALID_REDEFINITION); // } + @Test public void testBug8342b() throws Exception { IASTTranslationUnit tu = parse("extern int a; extern char a;", CPP); NameCollector col = new NameCollector(); @@ -3762,6 +3916,7 @@ public void testBug8342b() throws Exception { // void f() { // B::i; // } + @Test public void testNamespaceAlias_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3792,6 +3947,7 @@ public void testNamespaceAlias_b() throws Exception { // void test() { // MACRO; // } + @Test public void testNamespaceAliasInMacroExpansion_506668() throws Exception { parseAndCheckBindings(); } @@ -3800,6 +3956,7 @@ public void testNamespaceAliasInMacroExpansion_506668() throws Exception { // class B : public A { // B () : A() {} // }; + @Test public void testBug89539() throws Exception { String content = getAboveComment(); IASTTranslationUnit tu = parse(content, CPP); @@ -3825,6 +3982,7 @@ public void testBug89539() throws Exception { // A * a; // }; // class A; + @Test public void testBug89851() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3836,6 +3994,7 @@ public void testBug89851() throws Exception { assertTrue(col.getName(3).resolveBinding() instanceof ICPPClassType); } + @Test public void testBug89828() throws Exception { IASTTranslationUnit tu = parse("class B * b; void f(); void f(int);", CPP); NameCollector col = new NameCollector(); @@ -3862,6 +4021,7 @@ public void testBug89828() throws Exception { // f(A::t1); // } // }; + @Test public void testBug90039() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3877,6 +4037,7 @@ public void testBug90039() throws Exception { // void f(void) { // enum { one }; // } + @Test public void testBug90039b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3893,6 +4054,7 @@ public void testBug90039b() throws Exception { // operator int(); // char& operator[](unsigned int); // }; + @Test public void testOperatorConversionNames() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3917,6 +4079,7 @@ public void testOperatorConversionNames() throws Exception { // X::operator int() { } // template class X { operator int(); }; // template X::operator int() { } + @Test public void testBug36769B() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3959,6 +4122,7 @@ public void testBug36769B() throws Exception { assertNotNull(((ICPPASTConversionName) int4).getTypeId()); } + @Test public void testBug88662() throws Exception { IASTTranslationUnit tu = parse("int foo() { return int();}", CPP); IASTReturnStatement returnStatement = (IASTReturnStatement) ((IASTCompoundStatement) ((IASTFunctionDefinition) tu @@ -3969,6 +4133,7 @@ public void testBug88662() throws Exception { assertEquals(expression.getSimpleType(), ICPPASTSimpleTypeConstructorExpression.t_int); } + @Test public void testBug90498a() throws Exception { IASTTranslationUnit tu = parse("typedef int INT;\ntypedef INT (FOO) (INT);", CPP); @@ -3984,6 +4149,7 @@ public void testBug90498a() throws Exception { assertEquals(nested.getName().toString(), "FOO"); } + @Test public void testBug90498b() throws Exception { IASTTranslationUnit tu = parse("int (* foo) (int) (0);", CPP); @@ -4007,6 +4173,7 @@ public void testBug90498b() throws Exception { // typeid(d1) == typeid(d2); // typeid(D) == typeid(d2); // } + @Test public void testBug866274() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTFunctionDefinition foo = (IASTFunctionDefinition) tu.getDeclarations()[3]; @@ -4030,6 +4197,7 @@ public void testBug866274() throws Exception { } } + @Test public void testTypedefFunction() throws Exception { IASTTranslationUnit tu = parse("typedef int foo (int);", CPP); NameCollector col = new NameCollector(); @@ -4046,6 +4214,7 @@ public void testTypedefFunction() throws Exception { // typedef A B; // // B a = B(1); + @Test public void testTypedefConstructorCall() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPConstructor ctor = bh.assertNonProblem("A(int x)", "A", ICPPConstructor.class); @@ -4062,6 +4231,7 @@ public void testTypedefConstructorCall() throws Exception { // void foo(){ // f((1, 2)); // } + @Test public void testBug90616() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4072,6 +4242,7 @@ public void testBug90616() throws Exception { assertSame(f1, f2); } + @Test public void testBug90603() throws Exception { IASTTranslationUnit tu = parse("class X { void f(){} };", CPP); NameCollector col = new NameCollector(); @@ -4095,6 +4266,7 @@ public void testBug90603() throws Exception { // class X { }; // X x; // class X { }; + @Test public void testBug90662() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4153,6 +4325,7 @@ public void testBug90662() throws Exception { // const C& operator <(const C&); // const C& operator>(const C&); // }; + @Test public void testOperatorNames() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4206,6 +4379,7 @@ public void testOperatorNames() throws Exception { // struct C { // auto operator<=>(const C&); // }; + @Test public void testThreeWayComparisonOperatorName() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.STDCPP20); NameCollector col = new NameCollector(); @@ -4228,6 +4402,7 @@ public void testThreeWayComparisonOperatorName() throws Exception { // static constexpr auto greater01 = greater(0, 1); // static constexpr auto greater00 = greater(0, 0); // static constexpr auto greater10 = greater(1, 0); + @Test public void testThreeWayComparisonSimpleCase() throws Exception { BindingAssertionHelper helper = getAssertionHelper(CPP, ScannerKind.STDCPP20); helper.assertVariableValue("less01", 1); @@ -4252,6 +4427,7 @@ public void testThreeWayComparisonSimpleCase() throws Exception { // }; // // constexpr auto value = V1 | V2; + @Test public void testBinaryOperatorOverloadTemplate() throws Exception { BindingAssertionHelper helper = getAssertionHelper(CPP); helper.assertVariableValue("value", 42); @@ -4265,6 +4441,7 @@ public void testBinaryOperatorOverloadTemplate() throws Exception { // typedef char I; // typedef I I; // }; + @Test public void testBug90623() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4298,6 +4475,7 @@ public void testBug90623() throws Exception { // typedef int I; // void f11(I i); // void main(){ f a; } + @Test public void testBug90623b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4317,6 +4495,7 @@ public void testBug90623b() throws Exception { // }; // Y y; // X* x = new X(y); + @Test public void testBug90654a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(true); @@ -4333,6 +4512,7 @@ public void testBug90654a() throws Exception { // int f(int); // int f(float); // int x = f(a); + @Test public void testBug90654b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4351,6 +4531,7 @@ public void testBug90654b() throws Exception { // this->A::operator=(s); // return *this; // } + @Test public void testBug90653() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4372,6 +4553,7 @@ public void testBug90653() throws Exception { // void foo() { // f("test"); // } + @Test public void testBug86618() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4386,6 +4568,7 @@ public void testBug86618() throws Exception { // void foo () { // f(g) ; // } + @Test public void testBug45129() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4411,6 +4594,7 @@ public void testBug45129() throws Exception { // ABC::DEF * var; // ABC::GHI * value; // } + @Test public void testAmbiguousStatements() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTDeclaration[] declarations = tu.getDeclarations(); @@ -4425,6 +4609,7 @@ public void testAmbiguousStatements() throws Exception { // union { int a; char* p; }; // a = 1; // } + @Test public void testBug86639() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4439,6 +4624,7 @@ public void testBug86639() throws Exception { // int aa1, aa2; // a; // } + @Test public void testBug80940() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4463,6 +4649,7 @@ public void testBug80940() throws Exception { // const Ex * e; // e->d(); // } + @Test public void testBug77024() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4490,6 +4677,7 @@ public void testBug77024() throws Exception { // Point() : xCoord(0) {} // int xCoord; // }; + @Test public void testBug91773() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4500,6 +4688,7 @@ public void testBug91773() throws Exception { assertSame(x, x2); } + @Test public void testBug90648() throws ParserException { IASTTranslationUnit tu = parse("int f() { int (&ra)[3] = a; }", CPP); IASTFunctionDefinition f = (IASTFunctionDefinition) tu.getDeclarations()[0]; @@ -4513,6 +4702,7 @@ public void testBug90648() throws ParserException { assertTrue(declarators[0] instanceof IASTArrayDeclarator); } + @Test public void testBug92980() throws Exception { String code = "struct A { A(); A(const A&) throw(1); ~A() throw(X); };"; parse(code, CPP, ScannerKind.GNU, false); @@ -4520,6 +4710,7 @@ public void testBug92980() throws Exception { // class Dummy { int v(); int d; }; // void Dummy::v(int){ d++; } + @Test public void testBug92882() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4538,6 +4729,7 @@ public void testBug92882() throws Exception { // f(3); // f(); // } + @Test public void testBug86547() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4547,6 +4739,7 @@ public void testBug86547() throws Exception { assertInstances(col, f1, 5); } + @Test public void testBug90647() throws Exception { parse("char msg[] = \"Syntax error on line %s\\n\";", CPP); } @@ -4564,6 +4757,7 @@ public void testBug90647() throws Exception { // int k; // k = sum; // } + @Test public void testBug82766() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4577,6 +4771,7 @@ public void testBug82766() throws Exception { // char *c; // l |= ((unsigned long)(*((c)++)))<<24; // } + @Test public void testBug77385() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4584,6 +4779,7 @@ public void testBug77385() throws Exception { assertNoProblemBindings(col); } + @Test public void testBug83997() throws Exception { IASTTranslationUnit tu = parse("namespace { int x; }", CPP); NameCollector col = new NameCollector(); @@ -4591,6 +4787,7 @@ public void testBug83997() throws Exception { assertNoProblemBindings(col); } + @Test public void testBug85786() throws Exception { IASTTranslationUnit tu = parse("void f(int); void foo () { void * p = &f; ((void (*) (int)) p) (1); }", ParserLanguage.C); @@ -4604,6 +4801,7 @@ public void testBug85786() throws Exception { // static int arr[ n ]; // }; // int C::arr[n]; + @Test public void testBug90610() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4629,6 +4827,7 @@ public void testBug90610() throws Exception { // int X::y = 1; // int (*g(int))(int); // int (*pf)(int); + @Test public void testDeclDefn() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4655,6 +4854,7 @@ public void testDeclDefn() throws Exception { // int f(int); // int (&rfi)(int) = f; // int (&rfd)(double) = f; + @Test public void testBug95200() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4667,6 +4867,7 @@ public void testBug95200() throws Exception { assertSame(col.getName(9).resolveBinding(), f1); } + @Test public void testBug95425() throws Exception { IASTTranslationUnit tu = parse("class A { A(); };", CPP); NameCollector col = new NameCollector(); @@ -4696,6 +4897,7 @@ public void testBug95425() throws Exception { // char x[100]; // f(x); // } + @Test public void testBug95461() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4710,6 +4912,7 @@ public void testBug95461() throws Exception { // A * b = 0; // A & c = 0; // } + @Test public void testAmbiguity() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTSimpleDeclaration A = (IASTSimpleDeclaration) tu.getDeclarations()[0]; @@ -4738,6 +4941,7 @@ public void testAmbiguity() throws Exception { // F f; // f.A::a = 1; // } + @Test public void testBug84696() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4761,6 +4965,7 @@ public void testBug84696() throws Exception { // int a; // }; // int X:: * pmi = &X::a; + @Test public void testBasicPointerToMember() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); assertEquals(tu.getDeclarations().length, 2); @@ -4779,6 +4984,7 @@ public void testBasicPointerToMember() throws Exception { // void foo() { // (waldo()->*true).meow(); // Method 'meow' could not be resolved // } + @Test public void testOverloadedPointerToMemberOperator_488611() throws Exception { parseAndCheckBindings(); } @@ -4788,6 +4994,7 @@ public void testOverloadedPointerToMemberOperator_488611() throws Exception { // void foo(D* dp) { // B* bp = dynamic_cast(dp); // } + @Test public void testBug84466() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); ICPPASTCastExpression dynamic_cast = (ICPPASTCastExpression) ((IASTEqualsInitializer) ((IASTSimpleDeclaration) ((IASTDeclarationStatement) ((IASTCompoundStatement) ((IASTFunctionDefinition) tu @@ -4797,6 +5004,7 @@ public void testBug84466() throws Exception { assertEquals(dynamic_cast.getOperator(), ICPPASTCastExpression.op_dynamic_cast); } + @Test public void testBug88338_CPP() throws Exception { IASTTranslationUnit tu = parse("struct A; struct A* a;", CPP); NameCollector col = new NameCollector(); @@ -4815,6 +5023,7 @@ public void testBug88338_CPP() throws Exception { assertFalse(col.getName(0).isReference()); } + @Test public void testPointerToFunction_CPP() throws Exception { IASTTranslationUnit tu = parse("int (*pfi)();", CPP); assertEquals(tu.getDeclarations().length, 1); @@ -4831,6 +5040,7 @@ public void testPointerToFunction_CPP() throws Exception { // X a[10]; // a[0].bar; // } + @Test public void testBug95484() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4844,6 +5054,7 @@ public void testBug95484() throws Exception { // void f(const char * const * argv){ // strcmp(*argv); // } + @Test public void testBug95419() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4861,6 +5072,7 @@ public void testBug95419() throws Exception { // public: Sub(Other *); // }; // Sub::Sub(Other * b) : Base(b) {} + @Test public void testBug95673() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); @@ -4875,6 +5087,7 @@ public void testBug95673() throws Exception { // mem(x, "FUNC"); // mem(x + offset, "FUNC2"); // } + @Test public void testBug95768() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4892,6 +5105,7 @@ public void testBug95768() throws Exception { // int Foo::import(){ // trace(this); // } + @Test public void testBug95741() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4908,6 +5122,7 @@ public void testBug95741() throws Exception { // RTCharacter::operator char(void)const { // return value; // } + @Test public void testBug95692() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4922,6 +5137,7 @@ public void testBug95692() throws Exception { // str(0); // str(00); str(0x0); // } + @Test public void testBug95734() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4939,6 +5155,7 @@ public void testBug95734() throws Exception { // str(1.2); // str(ONE); str(p); // } + @Test public void testBug95734b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -4954,6 +5171,7 @@ public void testBug95734b() throws Exception { // char * value; // ::operator delete(value); // } + @Test public void testBug95786() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -4971,6 +5189,7 @@ public void testBug95786() throws Exception { // catch (...) // { // } + @Test public void testBug86868() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); assertEquals(tu.getDeclarations().length, 1); @@ -4979,6 +5198,7 @@ public void testBug86868() throws Exception { // void f(int t){ // int s (t); // } + @Test public void testBug94779() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTDeclarationStatement ds = (IASTDeclarationStatement) ((IASTCompoundStatement) ((IASTFunctionDefinition) tu @@ -4989,6 +5209,7 @@ public void testBug94779() throws Exception { // int t= 0; // int s (t); + @Test public void testBug211756() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTSimpleDeclaration sd = (IASTSimpleDeclaration) (tu.getDeclarations()[1]); @@ -5003,6 +5224,7 @@ public void testBug211756() throws Exception { // ci->state; // (ci - 1)->state; // } + @Test public void testBug95714() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5015,6 +5237,7 @@ public void testBug95714() throws Exception { // float _Complex x; // double _Complex y; + @Test public void testBug95757() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); IASTDeclaration[] decls = tu.getDeclarations(); @@ -5034,6 +5257,7 @@ public void testBug95757() throws Exception { // void f(){ // A::i++; // } + @Test public void testTypedefQualified() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5051,6 +5275,7 @@ public void testTypedefQualified() throws Exception { // int b(f()); // return a+b; // } + @Test public void testBug86849() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5063,6 +5288,7 @@ public void testBug86849() throws Exception { // void f(A * a) { // copy(a); // } + @Test public void testBug96655() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5072,6 +5298,7 @@ public void testBug96655() throws Exception { assertSame(copy, col.getName(7).resolveBinding()); } + @Test public void testBug96678() throws Exception { parse("int x; // comment \r\n", CPP, ScannerKind.STD, true); } @@ -5081,6 +5308,7 @@ public void testBug96678() throws Exception { // void f() { // copy(new A()); // } + @Test public void testNewExpressionType() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5093,6 +5321,7 @@ public void testNewExpressionType() throws Exception { // class A { // A(int i = 0); // }; + @Test public void testDefaultConstructor() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5116,6 +5345,7 @@ public void testDefaultConstructor() throws Exception { // b->foo; // b[0].foo; // } + @Test public void testBug91707() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5133,6 +5363,7 @@ public void testBug91707() throws Exception { // class C {}; // }; // class A::B{}; + @Test public void testBug92425() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5152,6 +5383,7 @@ public void testBug92425() throws Exception { // struct F {} f; // void f(int a) {} // } + @Test public void testBug92425b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5167,12 +5399,14 @@ public void testBug92425b() throws Exception { // A< B< C< D< E< F< G< H > > > > > > > a; // int A::B::* b; + @Test public void testBug98704() throws Exception { parse(getAboveComment(), CPP); } // void f(); // void f(void) {} + @Test public void testBug_AIOOBE() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5187,6 +5421,7 @@ public void testBug_AIOOBE() throws Exception { // void f(const int); // void f(int); // void g() { f(1); } + @Test public void testRankingQualificationConversions_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5198,6 +5433,7 @@ public void testRankingQualificationConversions_a() throws Exception { // void f(const volatile int); // void f(const int); // void g() { f(1); } + @Test public void testRankingQualificationConversions_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5225,6 +5461,7 @@ public void testRankingQualificationConversions_b() throws Exception { // i(&ca); // i(const int *) // i(&a); // i(int * const &) // } + @Test public void testRankingQualificationConversions_c() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5270,6 +5507,7 @@ public void testRankingQualificationConversions_c() throws Exception { // void A::f(){} // } // } + @Test public void testBug98818() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5297,6 +5535,7 @@ public void testBug98818() throws Exception { // A a; // a.B.i; a.C.j; // } + @Test public void testAnonymousStructures() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -5308,6 +5547,7 @@ public void testAnonymousStructures() throws Exception { assertSame(j, col.getName(5).resolveBinding()); } + @Test public void testBug99262() throws Exception { parse("void foo() {void *f; f=__null;}", CPP, ScannerKind.GNU, true); } @@ -5317,11 +5557,13 @@ public void testBug99262() throws Exception { // void f2() { // f1(__null); // } + @Test public void testBug240567() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("f1(__null", 2, ICPPFunction.class); } + @Test public void testBug100408() throws Exception { IASTTranslationUnit tu = parse("int foo() { int x=1; (x)*3; }", CPP); NameCollector col = new NameCollector(); @@ -5329,6 +5571,7 @@ public void testBug100408() throws Exception { assertNoProblemBindings(col); } + @Test public void testBug84478c() throws Exception { IASTTranslationUnit tu = parse("void foo() { switch(int x = 4) { case 4: x++; break; default: break;} }", CPP); NameCollector col = new NameCollector(); @@ -5337,6 +5580,7 @@ public void testBug84478c() throws Exception { assertSame(col.getName(1).resolveBinding(), col.getName(2).resolveBinding()); } + @Test public void testBug84478d() throws Exception { IASTTranslationUnit tu = parse("void foo() { for(int i = 0; int j = 0; ++i) {} }", CPP); NameCollector col = new NameCollector(); @@ -5353,6 +5597,7 @@ public void testBug84478d() throws Exception { // a++; b++; // } // } + @Test public void testBug84478b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -5377,6 +5622,7 @@ public void testBug84478b() throws Exception { // void f(char** p) { // free(p); // } + @Test public void testBug100415() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -5397,6 +5643,7 @@ public void testBug100415() throws Exception { // friend class X; // }; // } + @Test public void testBug86688() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -5412,6 +5659,7 @@ public void testBug86688() throws Exception { // int m::f(); // }; // int m::f(){} + @Test public void testBug100403() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -5431,6 +5679,7 @@ public void testBug100403() throws Exception { // friend void A::f1(AT); // friend void A::f2(BT); // }; + @Test public void testBug90609() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -5454,6 +5703,7 @@ public void testBug90609() throws Exception { // e->blah; // } // } + @Test public void testBug103281() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -5466,6 +5716,7 @@ public void testBug103281() throws Exception { assertSame(blah, col.getName(6).resolveBinding()); } + @Test public void testBug78800() throws Exception { parseAndCheckBindings( "class Matrix { public: Matrix & operator *(Matrix &); }; Matrix rotate, translate; Matrix transform = rotate * translate;"); @@ -5478,6 +5729,7 @@ public void testBug78800() throws Exception { // void X::foo() { // i; // } + @Test public void test10_2s3b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -5495,6 +5747,7 @@ public void test10_2s3b() throws Exception { // int f() { // int x = 4; while(x < 10) blah: ++x; // } + @Test public void testBug1043290() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment()); IASTFunctionDefinition fd = (IASTFunctionDefinition) tu.getDeclarations()[0]; @@ -5511,6 +5764,7 @@ public void testBug1043290() throws Exception { // do { ++i; } while(i < 10); // return 0; // } + @Test public void testBug104800() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment()); IASTFunctionDefinition f = (IASTFunctionDefinition) tu.getDeclarations()[0]; @@ -5518,6 +5772,7 @@ public void testBug104800() throws Exception { assertEquals(body.getStatements().length, 3); } + @Test public void testBug107150() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("#define FUNC_PROTOTYPE_PARAMS(list) list\r\n"); @@ -5551,6 +5806,7 @@ public void testBug107150() throws Exception { // int FooClass::foo() { // return 0; // } + @Test public void testBug108202() throws Exception { parse(getAboveComment(), CPP, ScannerKind.GNU, true); } @@ -5561,6 +5817,7 @@ public void testBug108202() throws Exception { // static int MyClass::static_field; // }; // int MyClass::static_field; + @Test public void testBug174791() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -5599,6 +5856,7 @@ public void testBug174791() throws Exception { // } // void nsSplit::a() { // } + @Test public void testBug180979() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -5615,6 +5873,7 @@ public void testBug180979() throws Exception { // #define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) { // _GLIBCXX_BEGIN_NAMESPACE(std) // } // end the namespace + @Test public void testBug195701() throws Exception { parse(getAboveComment(), CPP, ScannerKind.GNU, true); } @@ -5626,6 +5885,7 @@ public void testBug195701() throws Exception { // double operator*(double); // using A::operator*; // }; + @Test public void testBug178059() throws Exception { parse(getAboveComment(), CPP, ScannerKind.GNU, true); } @@ -5633,6 +5893,7 @@ public void testBug178059() throws Exception { // void foo (void *p) throw () ; // void bar (void *p) __attribute__ ((__nonnull__(1))); // void zot (void *p) throw () __attribute__ ((__nonnull__(1))); + @Test public void testBug179712() throws Exception { parse(getAboveComment(), CPP, ScannerKind.GNU, true); } @@ -5667,6 +5928,7 @@ public void testBug179712() throws Exception { // problem4(ptm); // problem5(ptm); // } + @Test public void testBug214335() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -5696,6 +5958,7 @@ public void testBug214335() throws Exception { // } // outer::foo x; // outer::inner::foo y; + @Test public void testAttributeInUsingDirective_351228() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -5721,6 +5984,7 @@ public void testAttributeInUsingDirective_351228() throws Exception { // fs(); // fs(1); // } + @Test public void testReferencesOfUsingDecls() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -5803,6 +6067,7 @@ public void testReferencesOfUsingDecls() throws Exception { // void O::I::f() { // a=0; // } + @Test public void testUsingDirectiveWithNestedClass_209582() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -5822,6 +6087,7 @@ public void testUsingDirectiveWithNestedClass_209582() throws Exception { // Test foo2 (bar, pBar); // Test foo3 (&bar); // } + @Test public void testCastAmbiguity_211756() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -5836,6 +6102,7 @@ public void testCastAmbiguity_211756() throws Exception { // if (relayIndex < 0 || relayIndex > numRelays) // return 0; // } + @Test public void testTemplateIDAmbiguity_104706() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -5859,6 +6126,7 @@ public void testTemplateIDAmbiguity_104706() throws Exception { // (base::has_trivial_copy::value && // base::has_trivial_destructor::value)> // realloc_ok; + @Test public void testTemplateIDAmbiguity_228118() throws Exception { parse(getAboveComment(), CPP); } @@ -5874,6 +6142,7 @@ public void testTemplateIDAmbiguity_228118() throws Exception { // func(qualified); // func(unqualified); // } + @Test public void testScopeOfUsingDelegates_219424() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -5889,6 +6158,7 @@ public void testScopeOfUsingDelegates_219424() throws Exception { // void Test::member1(){ // member2(); // } + @Test public void testQualifiedMemberDeclaration_222026() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5937,6 +6207,7 @@ public void testQualifiedMemberDeclaration_222026() throws Exception { // void Test::member1(){ // member2(); // } + @Test public void testQualifiedMemberDeclarationInNamespace_222026() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -5979,6 +6250,7 @@ public void testQualifiedMemberDeclarationInNamespace_222026() throws Exception } // namespace ns { typedef int ns::TINT; } // illegal, still no CCE is expected. + @Test public void testQualifiedTypedefs_222093() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IBinding td = bh.assertProblem("TINT", 4); @@ -5991,11 +6263,13 @@ public void testQualifiedTypedefs_222093() throws Exception { // if (a > b) { // } // } + @Test public void testResettingTemplateIdScopesStack_223777() throws Exception { parseAndCheckBindings(getAboveComment()); } // long x= 10L; + @Test public void testLongLiteral_225534() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); IASTDeclarator decltor = ((IASTSimpleDeclaration) tu.getDeclarations()[0]).getDeclarators()[0]; @@ -6011,6 +6285,7 @@ public void testLongLiteral_225534() throws Exception { // short sh(0); // long l(0L); // long long ll(0LL); + @Test public void testInitializeUnsigned_245070() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -6063,6 +6338,7 @@ public void testInitializeUnsigned_245070() throws Exception { // foo/*k1*/(11.1L); // foo/*k2*/(11.1E1L); // } + @Test public void testLiteralsViaOverloads_225534() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); char[] cs = { 'a', 'b', 'e', 'f', 'g', 'h', 'i', 'j', 'k' }; @@ -6070,7 +6346,7 @@ public void testLiteralsViaOverloads_225534() throws Exception { for (int i = 1; i < (c < 'i' ? 4 : 3); i++) { ICPPFunction def = ba.assertNonProblem("foo/*_" + c + "*/", 3, ICPPFunction.class); ICPPFunction ref = ba.assertNonProblem("foo/*" + c + "" + i + "*/", 3, ICPPFunction.class); - assertSame("function ref: " + c + "" + i, def, ref); + assertSame(def, ref, "function ref: " + c + "" + i); } } } @@ -6096,6 +6372,7 @@ public void testLiteralsViaOverloads_225534() throws Exception { // SecondLevelProxy p2; // p2->doA(); // } + @Test public void testRecursiveUserDefinedFieldAccess_205964() throws Exception { parseAndCheckBindings(getAboveComment()); } @@ -6107,6 +6384,7 @@ public void testRecursiveUserDefinedFieldAccess_205964() throws Exception { // using ns::A; // // class B: public A {}; + @Test public void testBug235196() throws Exception { parseAndCheckBindings(getAboveComment()); } @@ -6123,6 +6401,7 @@ public void testBug235196() throws Exception { // X::~X() {} // X::operator int() {} // X::xtint(a); // 2 + @Test public void testEmptyDeclSpecifier() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("X {", 1, ICPPClassType.class); @@ -6158,6 +6437,7 @@ public void testEmptyDeclSpecifier() throws Exception { // new (T[f][f]); // new (p) (T[f][f]); // }; + @Test public void testNewPlacement() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment()); IASTFunctionDefinition fdef = getDeclaration(tu, 3); @@ -6185,6 +6465,7 @@ public void testNewPlacement() throws Exception { // void test() {} // + // } + @Test public void testTrailingSyntaxErrorInNamespace() throws Exception { final String comment = getAboveComment(); IASTTranslationUnit tu = parse(comment, CPP, ScannerKind.STD, false); @@ -6198,6 +6479,7 @@ public void testTrailingSyntaxErrorInNamespace() throws Exception { // void test() {} // + // } + @Test public void testTrailingSyntaxErrorInLinkageSpec() throws Exception { final String comment = getAboveComment(); IASTTranslationUnit tu = parse(comment, CPP, ScannerKind.STD, false); @@ -6209,6 +6491,7 @@ public void testTrailingSyntaxErrorInLinkageSpec() throws Exception { // class C; // void func(void (C::*m)(int) const); + @Test public void test233889_a() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPFunction func = bh.assertNonProblem("func(", 4, ICPPFunction.class); @@ -6231,6 +6514,7 @@ public void test233889_a() throws Exception { // func(&C::m1); // func(&C::m2); // } + @Test public void testBug233889_b() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPFunction fn1 = bh.assertNonProblem("func(&C::m1", 4, ICPPFunction.class); @@ -6252,6 +6536,7 @@ public void testBug233889_b() throws Exception { // void member3() volatile { foo(this);/*3*/ } // void member4() const volatile { foo(this);/*4*/ } // }; + @Test public void testThisType() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPFunction pt1 = ba.assertNonProblem("foo(this);/*1*/", 3, ICPPFunction.class); @@ -6284,6 +6569,7 @@ public void testThisType() throws Exception { // A* a2= new A(); // a2->foo();/*2*/ // } + @Test public void testMemberAccessOperator_a() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("foo();/*1*/", 3); @@ -6307,6 +6593,7 @@ public void testMemberAccessOperator_a() throws Exception { // B* b2= new B(); // b2->foo();/*2*/ // } + @Test public void testMemberAccessOperator_b() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPMethod m1 = ba.assertNonProblem("foo();/*1*/", 3, ICPPMethod.class); @@ -6323,6 +6610,7 @@ public void testMemberAccessOperator_b() throws Exception { // C c; // c->foo();/**/ // refers to A::foo // } + @Test public void testMemberAccessOperator_c() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("foo();/**/", 3); @@ -6336,6 +6624,7 @@ public void testMemberAccessOperator_c() throws Exception { // C c; // c->foo();/**/ // expect problem - foo is not in B // } + @Test public void testMemberAccessOperator_d() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("foo();/**/", 3); @@ -6352,6 +6641,7 @@ public void testMemberAccessOperator_d() throws Exception { // C2 c; // c->foo();/**/ // refers to A::foo // } + @Test public void testMemberAccessOperator_e() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("foo();/**/", 3); @@ -6363,6 +6653,7 @@ public void testMemberAccessOperator_e() throws Exception { // typeid(int).name(); // typeid(s).name(); // } + @Test public void testTypeid_209578() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6380,6 +6671,7 @@ public void testTypeid_209578() throws Exception { // f3(r); // f4(s); // } + @Test public void testArrayToPointerConversion() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("f1(p)", 2, ICPPFunction.class); @@ -6400,6 +6692,7 @@ public void testArrayToPointerConversion() throws Exception { // test(y); // test(z); // } + @Test public void testArrayToPtrConversionForTypedefs_239931() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6414,6 +6707,7 @@ public void testArrayToPtrConversionForTypedefs_239931() throws Exception { // test2(x); // test3(x); // } + @Test public void testAdjustmentOfParameterTypes_239975() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6428,11 +6722,13 @@ public void testAdjustmentOfParameterTypes_239975() throws Exception { // ptr2mem= reinterpret_cast(&A::m); // ptr2mem= (void (A::*)(int))(0); // } + @Test public void testTypeIdForPtrToMember_242197() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } // void restrict(); + @Test public void testRestrictIsNoCPPKeyword_228826() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP, ScannerKind.STD); @@ -6442,6 +6738,7 @@ public void testRestrictIsNoCPPKeyword_228826() throws Exception { // void test1(); // void test2() throw (); // void test3() throw (int); + @Test public void testEmptyExceptionSpecification_86943() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), CPP); @@ -6469,6 +6766,7 @@ public void testEmptyExceptionSpecification_86943() throws Exception { // } catch (const char &ex) { // } // } + @Test public void testScopeOfCatchHandler_209579() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6480,6 +6778,7 @@ public void testScopeOfCatchHandler_209579() throws Exception { // func(x); // func(y); // } + @Test public void testOverloadedFunction_248774() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPFunction func1 = helper.assertNonProblem("func(x)", 4, ICPPFunction.class); @@ -6499,6 +6798,7 @@ public void testOverloadedFunction_248774() throws Exception { // func(x[0]); // func(y[0]); // } + @Test public void testOverloadedOperator_248803() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPFunction func1 = helper.assertNonProblem("func(x[0])", 4, ICPPFunction.class); @@ -6524,6 +6824,7 @@ public void testOverloadedOperator_248803() throws Exception { // class C5 : C1 { // void m();//5 // }; + @Test public void testOverridden_248846() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPMethod m0 = helper.assertNonProblem("m();//0", 1, ICPPMethod.class); @@ -6586,6 +6887,7 @@ public void testOverridden_248846() throws Exception { // void test(A* p) { // p.a; // should not resolve // } + @Test public void testPointerMemberAccess_245068() throws Exception { final String comment = getAboveComment(); final boolean[] isCpps = { false, true }; @@ -6599,6 +6901,7 @@ public void testPointerMemberAccess_245068() throws Exception { // template class CT {}; // } // using ns::CT; + @Test public void testTemplateIdInUsingDecl_251199() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6610,6 +6913,7 @@ public void testTemplateIdInUsingDecl_251199() throws Exception { // struct B { // operator ns::A(); // problems on operator ns and on A // }; + @Test public void testNamespaceQualifiedOperator_256840() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -6622,6 +6926,7 @@ public void testNamespaceQualifiedOperator_256840() throws Exception { // void test(int p) { // f(p); // } + @Test public void testFunctionExtraArgument() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("f(p)", 1); @@ -6632,6 +6937,7 @@ public void testFunctionExtraArgument() throws Exception { // void test(int* p) { // f(p); // } + @Test public void testVariadicFunction_2500582() throws Exception { final String comment = getAboveComment(); final boolean[] isCpps = { false, true }; @@ -6650,6 +6956,7 @@ public void testVariadicFunction_2500582() throws Exception { // // Should resolve to f(Incomplete*) since 0 can be converted to Incomplete* // f(0); // } + @Test public void testVariadicFunction_2500583() throws Exception { final String comment = getAboveComment(); final boolean[] isCpps = { false, true }; @@ -6672,6 +6979,7 @@ public void testVariadicFunction_2500583() throws Exception { // c(i,i)= 0; // c(i) = 0; // } + @Test public void testFunctionCallOnLHS_252695() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code, CPP, ScannerKind.GNU); @@ -6688,6 +6996,7 @@ public void testFunctionCallOnLHS_252695() throws Exception { // class B; // template class B; // template class B {}; + @Test public void testInvalidClassRedeclaration_254961() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parse(code, CPP, ScannerKind.GNU, false); @@ -6706,6 +7015,7 @@ public void testInvalidClassRedeclaration_254961() throws Exception { // template class T> class B {}; // template class B; // template class B {}; + @Test public void testInvalidClassRedeclaration_364226() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parse(code, CPP, ScannerKind.GNU, false); @@ -6723,6 +7033,7 @@ public void testInvalidClassRedeclaration_364226() throws Exception { // }; // void Foo::foo(void) { // } + @Test public void testVoidParamInDefinition_257376() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6740,6 +7051,7 @@ public void testVoidParamInDefinition_257376() throws Exception { // ns::C* cptr= 0; // C c= C(cptr); // } + @Test public void testNoKoenigForConstructors() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6751,6 +7063,7 @@ public void testNoKoenigForConstructors() throws Exception { // void test() { // donothing(); // } + @Test public void testVoidViaTypedef_258694() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -6765,6 +7078,7 @@ public void testVoidViaTypedef_258694() throws Exception { // static int& x = y; // y is not defined // int y; // }; + @Test public void testScopeOfClassMember_259460() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("B b", 1, ICPPClassType.class); @@ -6784,6 +7098,7 @@ public void testScopeOfClassMember_259460() throws Exception { // RED, GREEN // }; // }; + @Test public void testScopeOfClassMember_259648() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("GREEN)", 5, IEnumerator.class); @@ -6802,6 +7117,7 @@ public void testScopeOfClassMember_259648() throws Exception { // func(*a); // func(*b); // } + @Test public void testSmartPointerReference_259680() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPFunction f1 = ba.assertNonProblem("func(*a)", 4, ICPPFunction.class); @@ -6819,6 +7135,7 @@ public void testSmartPointerReference_259680() throws Exception { // (c == c.a && (c // int func(int i) { return i; } + @Test public void testFriendFunction_438114() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPFunction f1 = bh.assertNonProblemOnFirstIdentifier("func(int i);"); @@ -7085,6 +7411,7 @@ public void testFriendFunction_438114() throws Exception { // ca.bar();/*7*/ // a.bar();/*8*/ // } + @Test public void testMemberFunctionDisambiguationByCVness_238409() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -7138,6 +7465,7 @@ public void testMemberFunctionDisambiguationByCVness_238409() throws Exception { // void blabla2() { // test2(e1); // } + @Test public void testOverloadResolution_262191() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -7152,6 +7480,7 @@ public void testOverloadResolution_262191() throws Exception { // void* h; // select (int (h) + 1); // } + @Test public void testSimpleTypeConstructorExpressions() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -7165,6 +7494,7 @@ public void testSimpleTypeConstructorExpressions() throws Exception { // void test() { // f(a()); // } + @Test public void testBug263152a() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("f(a())", 1); @@ -7181,6 +7511,7 @@ public void testBug263152a() throws Exception { // void test(B p) { // p.m(a()); // } + @Test public void testBug263152b() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("m(a())", 1, ICPPMethod.class); @@ -7210,6 +7541,7 @@ public void _testInstanceMemberInStaticMethod_263154() throws Exception { // for (;A* a = 0;) {a= 0;} // for (;B* b;) {b= 0;} // } + @Test public void testAmbiguityResolutionInCondition_263158() throws Exception { final String code = getAboveComment(); BindingAssertionHelper ba = new AST2AssertionHelper(code, true); @@ -7224,6 +7556,7 @@ public void testAmbiguityResolutionInCondition_263158() throws Exception { // void test(void* ptr) { // delete (type)(ptr); // } + @Test public void testAmbiguityResolutionInDeleteExpression_428922() throws Exception { final String code = getAboveComment(); BindingAssertionHelper ba = new AST2AssertionHelper(code, true); @@ -7245,6 +7578,7 @@ public void testAmbiguityResolutionInDeleteExpression_428922() throws Exception // f(r); // f(s); // } + @Test public void testPointerToNonPointerConversion_263159() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("f(p)", 1); @@ -7262,6 +7596,7 @@ public void testPointerToNonPointerConversion_263159() throws Exception { // fip(0); // fia(0); // } + @Test public void testNonPointerToPointerConversion_263707() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("fip(1)", 3); @@ -7278,6 +7613,7 @@ public void testNonPointerToPointerConversion_263707() throws Exception { // reset(new cl()); // reset(new cl[1]); // } + @Test public void testTypeOfNewExpression_264163() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -7292,6 +7628,7 @@ public void testTypeOfNewExpression_264163() throws Exception { // range ir(0); // onRange(ir); // } + @Test public void testConstructorTemplateInImplicitConversion_264314() throws Exception { final String code = getAboveComment(); BindingAssertionHelper ba = new AST2AssertionHelper(code, true); @@ -7312,6 +7649,7 @@ public void testConstructorTemplateInImplicitConversion_264314() throws Exceptio // template class CT {}; // CT ct1; // CT ct2; + @Test public void testConstTypedef_264474() throws Exception { final String code = getAboveComment(); BindingAssertionHelper ba = new AST2AssertionHelper(code, true); @@ -7359,6 +7697,7 @@ public void testConstTypedef_264474() throws Exception { // mpr(&X::cm); // cm is const // mprc(&X::m); // m is not const // } + @Test public void testMemberPtrs_264479() throws Exception { final String code = getAboveComment(); BindingAssertionHelper ba = new AST2AssertionHelper(code, true); @@ -7384,6 +7723,7 @@ public void testMemberPtrs_264479() throws Exception { // void test(int* p) { // f(!p); // } + @Test public void testTypeOfNotExpression_265779() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("f(!p)", 1); @@ -7408,6 +7748,7 @@ public void testTypeOfNotExpression_265779() throws Exception { // void test(B& p) { // p.waldo(); // } + @Test public void testDependentEnumeration_446711a() throws Exception { parseAndCheckBindings(); } @@ -7434,6 +7775,7 @@ public void testDependentEnumeration_446711a() throws Exception { // void test(B& p) { // p.waldo(); // } + @Test public void testDependentEnumeration_446711b() throws Exception { parseAndCheckBindings(); } @@ -7460,6 +7802,7 @@ public void testDependentEnumeration_446711b() throws Exception { // void test(B& p) { // p.waldo(); // } + @Test public void testDependentEnumeration_446711c() throws Exception { parseAndCheckBindings(); } @@ -7486,6 +7829,7 @@ public void testDependentEnumeration_446711c() throws Exception { // void test(B& p) { // p.waldo(); // } + @Test public void testDependentEnumeration_446711d() throws Exception { parseAndCheckBindings(); } @@ -7512,6 +7856,7 @@ public void testDependentEnumeration_446711d() throws Exception { // void test(B& p) { // p.waldo(); // } + @Test public void testDependentEnumeration_446711e() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertProblemOnFirstIdentifier(".waldo()"); @@ -7528,6 +7873,7 @@ public void testDependentEnumeration_446711e() throws Exception { // temp = new ::S*; // temp = new (::S*); // } + @Test public void testNewPointerOfClass_267168() throws Exception { parseAndCheckBindings(); } @@ -7536,6 +7882,7 @@ public void testNewPointerOfClass_267168() throws Exception { // void f2(const char *(n[])) { // if (n && 1){} // } + @Test public void testPointerToArrayWithDefaultVal_267184() throws Exception { final String code = getAboveComment(); BindingAssertionHelper ba = new AST2AssertionHelper(code, true); @@ -7555,6 +7902,7 @@ public void testPointerToArrayWithDefaultVal_267184() throws Exception { // virtual void pv() = 0; // void (*ptrToFunc) ()= 0; // }; + @Test public void testPureVirtualVsInitDeclarator_267184() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code, CPP); @@ -7587,6 +7935,7 @@ public void testPureVirtualVsInitDeclarator_267184() throws Exception { // a.operator S *(); // } // } + @Test public void testLookupScopeForConversionNames_267221() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -7600,6 +7949,7 @@ public void testLookupScopeForConversionNames_267221() throws Exception { // int func() { // bar((A){foo()}); // } + @Test public void testBug268714() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -7611,6 +7961,7 @@ public void testBug268714() throws Exception { // int ** x; // f(x); // } + @Test public void testRankingOfQualificationConversion_269321() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -7632,6 +7983,7 @@ public void testRankingOfQualificationConversion_269321() throws Exception { // (1 + x).a; //2 // (x + 1.0).b; //3 // } + @Test public void testOverloadResolutionForOperators_266211() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("a; //1", 1, ICPPField.class); @@ -7652,6 +8004,7 @@ public void testOverloadResolutionForOperators_266211() throws Exception { // (x + x).a; //1 // (x + 1.0).a; //2 // } + @Test public void testOverloadResolutionForOperators_268534() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("a; //1", 1, ICPPField.class); @@ -7666,6 +8019,7 @@ public void testOverloadResolutionForOperators_268534() throws Exception { // C* c= 0; // test(c); // } + @Test public void testInvalidUserDefinedConversion_269729() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("test(c)", 4); @@ -7682,6 +8036,7 @@ public void testInvalidUserDefinedConversion_269729() throws Exception { // foo('a'); // foo(L'a'); // } + @Test public void testWideCharacterLiteralTypes_270892() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -7697,6 +8052,7 @@ public void testWideCharacterLiteralTypes_270892() throws Exception { // auto u8 = u8""; // auto u = u""; // auto U = U""; + @Test public void testStringLiteralPrefixTypes_526724() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -7730,6 +8086,7 @@ protected IType createStringType(Kind kind) { // using ns::A; // struct A; // A a; + @Test public void testForwardDeclarationAfterUsing_271236() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertNonProblem("A a;", 1, ICPPClassType.class); @@ -7737,6 +8094,7 @@ public void testForwardDeclarationAfterUsing_271236() throws Exception { // template class Moo; // bool getFile(Moo & res); + @Test public void testScopeOfClassFwdDecl_270831() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPClassType t = ba.assertNonProblem("Foo", 3, ICPPClassType.class); @@ -7758,6 +8116,7 @@ public void testScopeOfClassFwdDecl_270831() throws Exception { // test(d1); // test(C c) has to be selected // test(d2); // test(C c) has to be selected // } + @Test public void testDerivedToBaseConversion_269318() throws Exception { final String code = getAboveComment(); BindingAssertionHelper ba = new AST2AssertionHelper(code, true); @@ -7781,6 +8140,7 @@ public void testDerivedToBaseConversion_269318() throws Exception { // } a; // // int i = bar(a(1)); + @Test public void testCallToObjectOfClassType_267389() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -7791,6 +8151,7 @@ public void testCallToObjectOfClassType_267389() throws Exception { // C(T); // ctor // C(s); // instance s; // }; + @Test public void testDeclarationAmbiguity_269953() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code, CPP); @@ -7812,6 +8173,7 @@ public void testDeclarationAmbiguity_269953() throws Exception { // typedef C3 T3; // T3::C3(int) { // } + @Test public void testCtorWithTypedef_269953() throws Exception { parseAndCheckBindings(); } @@ -7823,6 +8185,7 @@ public void testCtorWithTypedef_269953() throws Exception { // }; // typedef Compare MY_COMPARE; // template<> MY_COMPARE::Compare() {} + @Test public void testTemplateCTorWithTypedef_269953() throws Exception { parseAndCheckBindings(); } @@ -7852,6 +8215,7 @@ public void testTemplateCTorWithTypedef_269953() throws Exception { // d.base(); // Parser log reports ambiguity on 'base' // return 0; // } + @Test public void testHiddenVirtualBase_282993() throws Exception { parseAndCheckBindings(); } @@ -7863,6 +8227,7 @@ public void testHiddenVirtualBase_282993() throws Exception { // C c; // c()()()()()()()()()()()()()(); // } + @Test public void testNestedOverloadedFunctionCalls_283324() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code, CPP); @@ -7873,7 +8238,7 @@ public void testNestedOverloadedFunctionCalls_283324() throws Exception { assertInstance(t, ICPPClassType.class); assertTrue(stmt.getExpression().isLValue()); final long time = System.currentTimeMillis() - now; - assertTrue("Lasted " + time + "ms", time < 5000); + assertTrue(time < 5000, "Lasted " + time + "ms"); } // class A { @@ -7883,6 +8248,7 @@ public void testNestedOverloadedFunctionCalls_283324() throws Exception { // void test(A a) { // m(a); // } + @Test public void testInlineFriendFunction_284690() throws Exception { parseAndCheckBindings(); } @@ -7900,6 +8266,7 @@ public void testInlineFriendFunction_284690() throws Exception { // f(u1); // f(l1); // } + @Test public void testEnumToIntConversion_285368() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPFunction f1 = ba.assertNonProblem("f(i1)", 1, ICPPFunction.class); @@ -7931,6 +8298,7 @@ public void testEnumToIntConversion_285368() throws Exception { // void test() { // f(i3); // } + @Test public void testCastInEnumeratorValue_446380() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); IEnumerator i2 = ba.assertNonProblem("i2", IEnumerator.class); @@ -7949,6 +8317,7 @@ public void testCastInEnumeratorValue_446380() throws Exception { } // typedef enum enum_name enum_name; + @Test public void testTypedefRecursion_285457() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ba.assertProblem("enum_name", 9); @@ -7958,6 +8327,7 @@ public void testTypedefRecursion_285457() throws Exception { // enum MyEnum {}; // MyStruct(MyEnum value) {} // }; + @Test public void testEnumRedefinitionInStruct_385144() throws Exception { parseAndCheckBindings(); } @@ -7968,6 +8338,7 @@ public void testEnumRedefinitionInStruct_385144() throws Exception { // x a; // } // }; + @Test public void testLookupFromInlineFriend_284690() throws Exception { parseAndCheckBindings(); } @@ -7985,6 +8356,7 @@ public void testLookupFromInlineFriend_284690() throws Exception { // void PropertyValueList::hello() { // XInterface temp; // } + @Test public void testTypeLookupWithMultipleInheritance_286213() throws Exception { parseAndCheckBindings(); } @@ -8002,6 +8374,7 @@ public void testTypeLookupWithMultipleInheritance_286213() throws Exception { // return ContainerOf::numParts; // } // }; + @Test public void testInheritanceFromMultipleInstancesOfSameTemplate_383502() throws Exception { parseAndCheckBindings(); } @@ -8017,6 +8390,7 @@ public void testInheritanceFromMultipleInstancesOfSameTemplate_383502() throws E // static const int v8= 1; // }; // const int X::v7= 1; + @Test public void testVariableDefVsDecl_286259() throws Exception { String[] declNames = { "v3" }; String[] defNames = { "v1", "v2", "v4", "v5", "X::v7" }; @@ -8034,6 +8408,7 @@ public void testVariableDefVsDecl_286259() throws Exception { // static const int v2= 1; // }; // const int X::v2; + @Test public void testVariableDefVsDecl_292635() throws Exception { String[] declNames = { "v1" }; String[] defNames = { "X::v2" }; @@ -8051,6 +8426,7 @@ public void testVariableDefVsDecl_292635() throws Exception { // struct T; // struct T* m2; // }; + @Test public void testStructOwner_290693() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8076,6 +8452,7 @@ public void testStructOwner_290693() throws Exception { // int main() { // return ~0; // } + @Test public void testNonUserdefinedOperator_291409b() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code, CPP); @@ -8093,6 +8470,7 @@ public void testNonUserdefinedOperator_291409b() throws Exception { // inline void Test::t() { // t<1>(); // } + @Test public void testMethodTemplateWithSameName_292051() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8117,6 +8495,7 @@ public void testMethodTemplateWithSameName_292051() throws Exception { // C c= *new C(); // foo(c); // } + @Test public void testUserDefinedConversion_222444a() throws Exception { parseAndCheckBindings(); } @@ -8144,6 +8523,7 @@ public void testUserDefinedConversion_222444a() throws Exception { // x2(f); // x3(f); // } + @Test public void testUserDefinedConversion_222444b() throws Exception { parseAndCheckBindings(); } @@ -8164,6 +8544,7 @@ public void testUserDefinedConversion_222444b() throws Exception { // foo(c); // foo(cc); // } + @Test public void testUserDefinedConversion_222444c() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8180,6 +8561,7 @@ public void testUserDefinedConversion_222444c() throws Exception { // int main() { // return B == 23; // } + @Test public void testInvalidOverload_291409() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code, CPP); @@ -8196,6 +8578,7 @@ public void testInvalidOverload_291409() throws Exception { // int* ptr; // f(ptr); // } + @Test public void testParameterAdjustment_293538() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8213,6 +8596,7 @@ public void testParameterAdjustment_293538() throws Exception { // // ns::A::A() : CT(1) { // } + @Test public void testLookupInConstructorChainInitializer_293566() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8231,6 +8615,7 @@ public void testLookupInConstructorChainInitializer_293566() throws Exception { // f(ns::e1 | ns::e2); // the operator| needs to be looked up in the // // associated namespace. // } + @Test public void testAssociatedScopesForOverloadedOperators_293589() throws Exception { parseAndCheckBindings(); } @@ -8242,6 +8627,7 @@ public void testAssociatedScopesForOverloadedOperators_293589() throws Exception // friend F friendFunction; // template F methodTemplate; // }; + @Test public void testFunctionDeclViaTypedef_86495() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8278,6 +8664,7 @@ public void testFunctionDeclViaTypedef_86495() throws Exception { // xx(&a); // f(""); // } + @Test public void testCVQualifiersWithArrays_293982() throws Exception { parseAndCheckBindings(); } @@ -8292,6 +8679,7 @@ public void testCVQualifiersWithArrays_293982() throws Exception { // f(a); func(a); // f(b); func(b); // } + @Test public void testArrayTypeSizeFromInitializer_294144() throws Exception { parseAndCheckBindings(); } @@ -8302,6 +8690,7 @@ public void testArrayTypeSizeFromInitializer_294144() throws Exception { // } // template struct C {}; // }; + @Test public void testLookupInClassScopeForTemplateIDs_294904() throws Exception { parseAndCheckBindings(); } @@ -8315,6 +8704,7 @@ public void testLookupInClassScopeForTemplateIDs_294904() throws Exception { // void test() { // func(A::array); // } + @Test public void testCompleteArrayTypeWithIncompleteDeclaration_294144() throws Exception { parseAndCheckBindings(); } @@ -8323,6 +8713,7 @@ public void testCompleteArrayTypeWithIncompleteDeclaration_294144() throws Excep // int x,y; // return y < x ? -1 : y > x ? 1 : 0; // } + @Test public void testSyntax1_295064() throws Exception { parseAndCheckBindings(); } @@ -8332,6 +8723,7 @@ public void testSyntax1_295064() throws Exception { // CT(TInt); // }; // template inline CT::CT(TInt) {} + @Test public void testSyntax2_295064() throws Exception { parseAndCheckBindings(); } @@ -8349,6 +8741,7 @@ public void testSyntax2_295064() throws Exception { // }; // static_assert(sizeof(VMPage) == 1, "bla"); // } + @Test public void testStaticAssertions_294730() throws Exception { parseAndCheckBindings(); } @@ -8387,6 +8780,7 @@ public void testStaticAssertions_294730() throws Exception { // foo(source_const_ref()); // #1 // foo(source_const_rvalue_ref()); // #1 // } + @Test public void testRValueReference_294730() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8427,6 +8821,7 @@ public void testRValueReference_294730() throws Exception { // const LRI&& r3 = i; // r3 has the type int& // RRI& r4 = i; // r4 has the type int& // RRI&& r5 = i; // r5 has the type int&& + @Test public void testRValueReferenceTypedefs_294730() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8474,6 +8869,7 @@ public void testRValueReferenceTypedefs_294730() throws Exception { // drref(2); // rcd3 refers to temporary with value 2.0 // cdref(cvd); // error: type qualifiers dropped // } + @Test public void testDirectBinding_294730() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8499,6 +8895,7 @@ public void testDirectBinding_294730() throws Exception { // void test(int) { // test(s()); // } + @Test public void testSpecialRuleForImplicitObjectType_294730() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8555,6 +8952,7 @@ public void testSpecialRuleForImplicitObjectType_294730() throws Exception { // sink3(z7); // } + @Test public void testInitOfClassObjectsByRValues_294730() throws Exception { final CharSequence[] contents = getContents(3); final String code = contents[0].toString(); @@ -8581,6 +8979,7 @@ public void testInitOfClassObjectsByRValues_294730() throws Exception { // check(c+1); // check(c+a); // } + @Test public void testADLForOperators_296906() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8597,6 +8996,7 @@ public void testADLForOperators_296906() throws Exception { // f(a, '1'); // calls ns::f(ns::A, char) // f(a, 1); // calls ns::f(ns::A, char) // } + @Test public void testADL_299101() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8624,6 +9024,7 @@ public void testADL_299101() throws Exception { // __typeof(a->x) t7(); // type is const double // __typeof((a->x)) t8(); // type is const double + @Test public void testDecltype_294730() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code, CPP); @@ -8657,12 +9058,14 @@ public void testDecltype_294730() throws Exception { // decltype(w)::type i; // int x = decltype(w)::value; // } + @Test public void testDecltypeInNameQualifier_380751() throws Exception { parseAndCheckBindings(); } // struct Base {}; // struct Derived : decltype(Base()) {}; + @Test public void testDecltypeInBaseSpecifier_438348() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPClassType base = helper.assertNonProblem("struct Base", "Base"); @@ -8683,6 +9086,7 @@ public void testDecltypeInBaseSpecifier_438348() throws Exception { // decltype(bar()(S())) v; // v.waldo(); // } + @Test public void testDecltypeWithConstantLambda_397494() throws Exception { parseAndCheckBindings(); } @@ -8695,12 +9099,14 @@ public void testDecltypeWithConstantLambda_397494() throws Exception { // f([this] (int x) {}); // } // }; + @Test public void testLambdaWithCapture() throws Exception { parseAndCheckBindings(); } // int foo = 0; // auto bar = [foo] { return foo; }; + @Test public void testLambdaWithCapture_446225() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPVariable foo1 = bh.assertNonProblemOnFirstIdentifier("foo =", ICPPVariable.class); @@ -8728,6 +9134,7 @@ public void testLambdaWithCapture_446225() throws Exception { // int p; // waldo({[p](int arg) { return true; }}); // } + @Test public void testLambdaWithCaptureInInitializerList_488265() throws Exception { parseAndCheckBindings(); } @@ -8759,6 +9166,7 @@ public void testLambdaWithCaptureInInitializerList_488265() throws Exception { // }; // // S::S(int a) : f{a} {} // Member initializer + @Test public void testInitSyntax_302412() throws Exception { parseAndCheckBindings(); } @@ -8797,6 +9205,7 @@ public void testInitSyntax_302412() throws Exception { // fs({1.0,2.0,3.0}); // fs({}); // } + @Test public void testListInitialization_302412a() throws Exception { parseAndCheckBindings(); } @@ -8820,6 +9229,7 @@ public void testListInitialization_302412a() throws Exception { // A a{ 1.0,2.0 }; // OK, uses #1 // g({ "foo", "bar" }); // OK, uses #3 // } + @Test public void testListInitialization_302412b() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8870,6 +9280,7 @@ public void testListInitialization_302412b() throws Exception { // X x1; // x({x1}); // OK, lvalue reference to x1 // } + @Test public void testListInitialization_302412c() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8894,6 +9305,7 @@ public void testListInitialization_302412c() throws Exception { // f({'a', 'b'}); // OK: f(A(int,double)) user-defined conversion // f({1.0}); // narrowing not detected by cdt. // } + @Test public void testListInitialization_302412d() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8914,6 +9326,7 @@ public void testListInitialization_302412d() throws Exception { // h({1.0}); // error: narrowing // h({ }); // OK: identity conversion // } + @Test public void testListInitialization_302412e() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -8950,6 +9363,7 @@ public void testListInitialization_302412e() throws Exception { // fH(1); // no conversion from int to H // fH({1}); // H(G(1)) // } + @Test public void testListInitialization_302412f() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertProblem("f({1,1})", 1); @@ -8978,6 +9392,7 @@ public void testListInitialization_302412f() throws Exception { // waldo({short(1)}); // waldo({1, 2}); // } + @Test public void testListInitialization_439477a() throws Exception { parseAndCheckBindings(); } @@ -8989,6 +9404,7 @@ public void testListInitialization_439477a() throws Exception { // waldo({1, 2, 3}); // should resolve to waldo(int const (&)[3]) // waldo({1, 2, 3, 4}); // should not resolve // } + @Test public void testListInitialization_439477b() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -9024,6 +9440,7 @@ public void testListInitialization_439477b() throws Exception { // }; // // A waldo({{0}, {0}}); + @Test public void testListInitialization_458679() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -9040,6 +9457,7 @@ public void testListInitialization_458679() throws Exception { // void test() { // waldo({""}); // } + @Test public void testListInitialization_491842() throws Exception { parseAndCheckBindings(); } @@ -9055,6 +9473,7 @@ public void testListInitialization_491842() throws Exception { // A{1}; // A{1, 2}; // } + @Test public void testListInitializer_495227() throws Exception { parseAndCheckBindings(); BindingAssertionHelper ah = getAssertionHelper(); @@ -9089,6 +9508,7 @@ public void testListInitializer_495227() throws Exception { // int main() { // foo({3, 4.0, 'c'}); // 'foo' is ambiguous // } + @Test public void testAggregateInitialization_487555() throws Exception { parseAndCheckBindings(); } @@ -9111,6 +9531,7 @@ public void testAggregateInitialization_487555() throws Exception { // g1({a}); // g2({s}); // } + @Test public void testListInitializationOfClass() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -9129,6 +9550,7 @@ public void testListInitializationOfClass() throws Exception { // const str b = {"test", 4}; // ERROR, #2 fails, #1 is skipped explicit conversion // return str{p, i}; // OK, uses #1 to initialize, explicit constructor is considered too // } + @Test public void testListInitializationWithExplicitConstructor() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(true); @@ -9159,6 +9581,7 @@ public void testListInitializationWithExplicitConstructor() throws Exception { // const str b = {"test", 4}; // OK, #2 fails, uses #1 to initialize // return str{p, i}; // OK, uses #1 to initialize // } + @Test public void testListInitializationOfClassTypeId() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -9177,6 +9600,7 @@ public void testListInitializationOfClassTypeId() throws Exception { // auto t = new auto({1.0}); // auto x; // Error - missing initializer. // auto y = { 1.0, 5 }; // Error - inconsistent types in the array initializer. + @Test public void testAutoType_289542() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9210,6 +9634,7 @@ public void testAutoType_289542() throws Exception { // void test() { // for (auto a : a) {} // } + @Test public void testAutoType_305970() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPVariable x = bh.assertNonProblem("x =", 1, ICPPVariable.class); @@ -9222,6 +9647,7 @@ public void testAutoType_305970() throws Exception { // struct A { auto a = 1; }; // Auto-typed non-static fields are not allowed. // struct B { static auto b = 1; }; // Auto-typed static fields are ok. + @Test public void testAutoType_305987() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9233,6 +9659,7 @@ public void testAutoType_305987() throws Exception { // auto fpif1(int)->int(*)(int) // auto fpif2(int)->int(*)(int) {} + @Test public void testNewFunctionDeclaratorSyntax_305972() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9250,6 +9677,7 @@ public void testNewFunctionDeclaratorSyntax_305972() throws Exception { // enum EUnscoped1 {b1}; // enum EUnscoped2 : long {b2}; // enum EUnscoped3 : int; + @Test public void testScopedEnums_305975a() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9305,6 +9733,7 @@ public void testScopedEnums_305975a() throws Exception { // enum F y1 = a; // OK // enum E1 : int; // OK: E1 is un-scoped, underlying type is int // enum class F1; // OK: F1 is scoped, underlying type is int + @Test public void testScopedEnums_305975b() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -9313,6 +9742,7 @@ public void testScopedEnums_305975b() throws Exception { // enum class E x2 = E::a; // illegal (elaborated type specifier) // enum class F y2 = a; // illegal // enum E; // illegal + @Test public void testScopedEnums_305975c() throws Exception { String code = getAboveComment(); IASTTranslationUnit tu = parse(code, CPP, ScannerKind.GNU, false); @@ -9333,6 +9763,7 @@ public void testScopedEnums_305975c() throws Exception { // fint(Col::red); // error: no conversion to int // fbool(Col::red); // error: no Col to bool conversion // } + @Test public void testScopedEnums_305975d() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9364,6 +9795,7 @@ public void testScopedEnums_305975d() throws Exception { // i = p->f(X::xr); // OK // i = p->f(p->xl); // OK // } + @Test public void testScopedEnums_305975e() throws Exception { parseAndCheckBindings(); } @@ -9378,6 +9810,7 @@ public void testScopedEnums_305975e() throws Exception { // xdir d; // error: xdir not in scope // xl; // error: not in scope // } + @Test public void testScopedEnums_305975f() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9392,6 +9825,7 @@ public void testScopedEnums_305975f() throws Exception { // enum class Y {e1, e2= f(e1)+2, e3}; // enum A {e1, e2= e1+2, e3}; // enum B {e1, e2= f(e1)+2, e3}; + @Test public void testScopedEnums_305975g() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -9405,6 +9839,7 @@ public void testScopedEnums_305975g() throws Exception { // enum S::waldo1 : int { // someConstant = 1508 // }; + @Test public void testForwardDeclaringEnumAtClassScope_475894() throws Exception { parseAndCheckBindings(); } @@ -9417,6 +9852,7 @@ public void testForwardDeclaringEnumAtClassScope_475894() throws Exception { // f(sizeof(S::m)); // // f(sizeof(S::m + 1)); // Error not detected by CDT: reference to non-static member in subexpression // } + @Test public void testSizeofOfNonstaticMember_305979() throws Exception { parseAndCheckBindings(); } @@ -9431,11 +9867,13 @@ public void testSizeofOfNonstaticMember_305979() throws Exception { // B b; // b.waldo(); // } + @Test public void testSizeofReference_397342() throws Exception { parseAndCheckBindings(); } // constexpr int waldo = sizeof("cat\b\\\n"); + @Test public void testSizeofStringLiteralWithEscapeCharacters_459279() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPVariable waldo = helper.assertNonProblem("waldo"); @@ -9449,6 +9887,7 @@ public void testSizeofStringLiteralWithEscapeCharacters_459279() throws Exceptio // A& b; // }; // A* p; + @Test public void testSizeofStructWithReferenceField_397342() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IASTName nameB = bh.findName("B"); @@ -9461,6 +9900,7 @@ public void testSizeofStructWithReferenceField_397342() throws Exception { } // struct waldo {}; + @Test public void testSizeofEmptyStruct_457770() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IASTName nameWaldo = bh.findName("waldo"); @@ -9479,6 +9919,7 @@ public void testSizeofEmptyStruct_457770() throws Exception { // B b; // b.waldo(); // } + @Test public void testAlignof_451082() throws Exception { parseAndCheckBindings(); } @@ -9491,6 +9932,7 @@ public void testAlignof_451082() throws Exception { // f(c16); // f(c32); // } + @Test public void testNewCharacterTypes_305976() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9506,6 +9948,7 @@ public void testNewCharacterTypes_305976() throws Exception { // void (11); // return 42; // } + @Test public void testCastToVoid_309155() throws Exception { parseAndCheckBindings(); } @@ -9513,6 +9956,7 @@ public void testCastToVoid_309155() throws Exception { // void test() { // void *libHandle (0); // } + @Test public void testCtorInitializerForVoidPtr_314113() throws Exception { parseAndCheckBindings(); } @@ -9529,6 +9973,7 @@ public void testCtorInitializerForVoidPtr_314113() throws Exception { // C c; // f(c+1); // converts c to a char and calls operator+(int, int) // } + @Test public void testBuiltinOperators_294543a() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -9547,6 +9992,7 @@ public void testBuiltinOperators_294543a() throws Exception { // A a; // f(a= 1); // A cannot be converted to long& here // } + @Test public void testBuiltinOperators_294543b() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9564,6 +10010,7 @@ public void testBuiltinOperators_294543b() throws Exception { // int i; // f(i = a); // A converts to long&, builtin assignment to i used, f(long) called // } + @Test public void testBuiltinOperators_294543c() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), true); @@ -9596,6 +10043,7 @@ public void testBuiltinOperators_294543c() throws Exception { // f(a = 2); // OK, uses const assignment overload, calls f(A) // g(a = 3); // OK, uses const assignment overload, converts to int, calls g(long) // } + @Test public void testBuiltinOperators_294543d() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), true); @@ -9638,6 +10086,7 @@ public void testBuiltinOperators_294543d() throws Exception { // Y* m();//2 // Y* m(Y*);//3 // }; + @Test public void testOverrideSimpleCovariance_321617() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPMethod m0 = helper.assertNonProblem("m();//0", 1, ICPPMethod.class); @@ -9690,6 +10139,7 @@ public void testOverrideSimpleCovariance_321617() throws Exception { // c.f(); // c.C::f(); // } + @Test public void testResolutionToFinalOverrider_86654() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -9708,6 +10158,7 @@ public void testResolutionToFinalOverrider_86654() throws Exception { // X::X() = default; // int f(int) = delete; // auto g() -> int = delete; + @Test public void testDefaultedAndDeletedFunctions_305978() throws Exception { String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code); @@ -9737,6 +10188,7 @@ public void testDefaultedAndDeletedFunctions_305978() throws Exception { // const int b=12; // void f(int a= b) = delete ; + @Test public void testDefaultedAndDeletedFunctions_305978b() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -9778,6 +10230,7 @@ public void testDefaultedAndDeletedFunctions_305978b() throws Exception { // g(a); // gb(a); // } + @Test public void testInlineNamespace_305980a() throws Exception { parseAndCheckBindings(); } @@ -9791,6 +10244,7 @@ public void testInlineNamespace_305980a() throws Exception { // ns::m::a; // ns::a; // } + @Test public void testInlineNamespace_305980b() throws Exception { parseAndCheckBindings(); } @@ -9812,6 +10266,7 @@ public void testInlineNamespace_305980b() throws Exception { // ::f(1); // ::g(1); // } + @Test public void testInlineNamespace_305980c() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -9833,6 +10288,7 @@ public void testInlineNamespace_305980c() throws Exception { // } // } // void ns::f() {} + @Test public void testInlineNamespace_305980d() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -9864,6 +10320,7 @@ public void testInlineNamespace_305980d() throws Exception { // [](int p) -> char {}; // } // }; + @Test public void testLambdaExpression_316307a() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -9877,6 +10334,7 @@ public void testLambdaExpression_316307a() throws Exception { // return abs(a) < abs(b); // }); // } + @Test public void testLambdaExpression_316307b() throws Exception { parseAndCheckBindings(); } @@ -9889,6 +10347,7 @@ public void testLambdaExpression_316307b() throws Exception { // void waldo(); // function f = [this](){ waldo(); }; // }; + @Test public void testLambdaInDefaultMemberInitializer_494182() throws Exception { parseAndCheckBindings(); } @@ -9897,6 +10356,7 @@ public void testLambdaInDefaultMemberInitializer_494182() throws Exception { // // void f(const MyType& val); // void g(MyType& val); + @Test public void testTypeString_323596() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9921,6 +10381,7 @@ public void testTypeString_323596() throws Exception { // } // container cnt; // }; + @Test public void testConstMember_323599() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9941,6 +10402,7 @@ public void testConstMember_323599() throws Exception { // fint(pe + pe); // problem // fint(p + p); // converted to boolean and then int. // }; + @Test public void testExplicitConversionOperators() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -9958,6 +10420,7 @@ public void testExplicitConversionOperators() throws Exception { // D d; // C c (d); // } + @Test public void testExplicitOperatorInDirectInit() throws Exception { String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code); @@ -9976,6 +10439,7 @@ public void testExplicitOperatorInDirectInit() throws Exception { // f("abc"); // g("abc"); // } + @Test public void testRankingOfDeprecatedConversionOnStringLiteral() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -10002,6 +10466,7 @@ public void testRankingOfDeprecatedConversionOnStringLiteral() throws Exception // a+a; // xvalue // ar; // rvalue // } + @Test public void testXValueCategories() throws Exception { String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code); @@ -10040,6 +10505,7 @@ public void testXValueCategories() throws Exception { // int k = g(f1()); // calls g(const int&&) // int l = g(f2()); // calls g(const int&&) // } + @Test public void testRankingOfReferenceBindings_a() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IFunction g1 = bh.assertNonProblemOnFirstIdentifier("g(const int&)"); @@ -10070,6 +10536,7 @@ public void testRankingOfReferenceBindings_a() throws Exception { // A().p();//5 // calls A::p()&& // a.p();//6 // calls A::p()& // } + @Test public void testRankingOfReferenceBindings_b() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPMethod s1 = bh.assertNonProblem("operator<<(int)", 10); @@ -10104,6 +10571,7 @@ public void testRankingOfReferenceBindings_b() throws Exception { // S s1 = { 1.0, 2.0, 3.0 }; // invoke #1 // S s2 = { 1, 2, 3 }; // invoke #2 // S s3 = { }; // invoke #3 + @Test public void testEmptyInitializerList_324096() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -10134,6 +10602,7 @@ public void testEmptyInitializerList_324096() throws Exception { // int main() { // waldo({1, 2}); // } + @Test public void testIntToBoolConversionInInitList_521543() throws Exception { parseAndCheckBindings(); } @@ -10148,6 +10617,7 @@ public void testIntToBoolConversionInInitList_521543() throws Exception { // int i; // } // int j = A::i; + @Test public void testInlineNamespaceLookup_324096() throws Exception { parseAndCheckBindings(); } @@ -10161,6 +10631,7 @@ public void testInlineNamespaceLookup_324096() throws Exception { // C c; // f(true ? c : 1); // calls f(int), not f(C); // } + @Test public void testConditionalOperator_324853a() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IBinding f = bh.assertNonProblem("f(int);", 1); @@ -10176,6 +10647,7 @@ public void testConditionalOperator_324853a() throws Exception { // f(0 ? p : ""); // uses f(const char*); // g(0 ? p : ""); // converts "" to char* // } + @Test public void testConditionalOperator_324853b() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IBinding fc = bh.assertNonProblem("f(const char*);", 1); @@ -10197,6 +10669,7 @@ public void testConditionalOperator_324853b() throws Exception { // C c3 ({1,2}); // C(C(int, int)) // copy ctor is elided // C c4 ={1,2}; // C(C(int, int)) // copy ctor is elided // C c5 {1,2}; // C(int, int) + @Test public void testCtorForAutomaticVariables_156668() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -10229,6 +10702,7 @@ public void testCtorForAutomaticVariables_156668() throws Exception { // int number = 5; // g(&number); // } + @Test public void testTopLevelRestrictQualifier_327328() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -10249,6 +10723,7 @@ public void testTopLevelRestrictQualifier_327328() throws Exception { // f(&rnumber); // calls f(int* __restrict* a) // f(&number); // calls f(int** a) // } + @Test public void testOverloadingWithRestrictQualifier_327328() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -10266,6 +10741,7 @@ public void testOverloadingWithRestrictQualifier_327328() throws Exception { // }; // typedef const S T; // T::C c; + @Test public void testCVQualifiedClassName_328063() throws Exception { parseAndCheckBindings(); } @@ -10275,6 +10751,7 @@ public void testCVQualifiedClassName_328063() throws Exception { // for (int& x : array) // x *= 2; // } + @Test public void testRangeBasedForLoop_327223() throws Exception { parseAndCheckBindings(); } @@ -10293,6 +10770,7 @@ public void testRangeBasedForLoop_327223() throws Exception { // void test(D& c) { // func(c.get()); // error. // } + @Test public void testOverrideUsingDeclaredMethod_328802() throws Exception { parseAndCheckBindings(); } @@ -10308,6 +10786,7 @@ public void testOverrideUsingDeclaredMethod_328802() throws Exception { // int y; // }; // } + @Test public void testOwner() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPNamespace ns = bh.assertNonProblemOnFirstIdentifier("ns"); @@ -10326,11 +10805,13 @@ public void testOwner() throws Exception { // A(int a = f()); // static int f(); // }; + @Test public void testFwdLookupForDefaultArgument() throws Exception { parseAndCheckBindings(); } // auto f2 (); // missing late return type. + @Test public void testBug332114a() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); IBinding b = bh.assertNonProblem("f2", 0); @@ -10341,6 +10822,7 @@ public void testBug332114a() throws Exception { // enum E: short; // enum E: short; // enum E: short {e1, e2}; + @Test public void testBug332114b() throws Exception { parseAndCheckBindings(); } @@ -10353,6 +10835,7 @@ public void testBug332114b() throws Exception { // for (auto& s : array) // s.f(); // ERROR HERE // } + @Test public void testAutoTypeInRangeBasedFor_332883a() throws Exception { parseAndCheckBindings(); } @@ -10370,6 +10853,7 @@ public void testAutoTypeInRangeBasedFor_332883a() throws Exception { // for (auto s : range) // s.f(); // ERROR HERE // } + @Test public void testAutoTypeInRangeBasedFor_332883b() throws Exception { parseAndCheckBindings(); } @@ -10397,6 +10881,7 @@ public void testAutoTypeInRangeBasedFor_332883b() throws Exception { // for (const auto& r : p) // r.x; // } + @Test public void testAutoTypeInRangeBasedFor_332883c() throws Exception { parseAndCheckBindings(); } @@ -10413,6 +10898,7 @@ public void testAutoTypeInRangeBasedFor_332883c() throws Exception { // e.f(); // } // } + @Test public void testAutoTypeInRangeBasedFor_359653() throws Exception { parseAndCheckBindings(); } @@ -10430,6 +10916,7 @@ public void testAutoTypeInRangeBasedFor_359653() throws Exception { // int main() { // for (auto x : C()); // ERROR: Symbol 'begin' could not be resolved // } + @Test public void testRangedBasedFor_538517() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -10439,6 +10926,7 @@ public void testRangedBasedFor_538517() throws Exception { // int a, b; // B(T) : a(0), b(0) {} // }; + @Test public void testMemberInitializer_333200() throws Exception { parseAndCheckBindings(); } @@ -10447,6 +10935,7 @@ public void testMemberInitializer_333200() throws Exception { // template auto add(T t, U u) -> decltype(t + u) { // return t + u; // } + @Test public void testResolutionInTrailingReturnType_333256() throws Exception { parseAndCheckBindings(); } @@ -10457,6 +10946,7 @@ public void testResolutionInTrailingReturnType_333256() throws Exception { // struct Derived : Base { // virtual auto waldo() -> bool override; // }; + @Test public void testOverrideSpecifierAfterTrailingReturnType_489876() throws Exception { parseAndCheckBindings(); } @@ -10469,6 +10959,7 @@ public void testOverrideSpecifierAfterTrailingReturnType_489876() throws Excepti // // auto (*z1)() -> auto(*)() -> int(*)(); // int (*(*(*z2)())())(); + @Test public void testTrailingReturnTypeInFunctionPointer() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -10492,6 +10983,7 @@ public void testTrailingReturnTypeInFunctionPointer() throws Exception { // CHAINER c; // test((c,0,1)); // } + @Test public void testOverloadedCommaOpWithConstClassRef_334955() throws Exception { parseAndCheckBindings(); } @@ -10509,6 +11001,7 @@ public void testOverloadedCommaOpWithConstClassRef_334955() throws Exception { // os ss; // (ss << "").ok; // } + @Test public void testOverloadedOperatorWithInheritanceDistance_335387() throws Exception { parseAndCheckBindings(); } @@ -10533,12 +11026,14 @@ public void testOverloadedOperatorWithInheritanceDistance_335387() throws Except // void waldo(Bitmap& icon) { // icon.IsOk(); // ERROR: "Method 'IsOk' could not be resolved" // } + @Test public void testBaseComputationWhileTypeIsIncomplete_498393() throws Exception { parseAndCheckBindings(); } // namespace ns {int a;} // using ns::a; + @Test public void testPropertyOfUsingDeclaration() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); ICPPASTUsingDeclaration udecl = getDeclaration(tu, 1); @@ -10556,6 +11051,7 @@ public void testPropertyOfUsingDeclaration() throws Exception { // S s[1]; // s->foo(); // } + @Test public void testMemberAccessForArray_347298() throws Exception { parseAndCheckBindings(); } @@ -10570,6 +11066,7 @@ public void testMemberAccessForArray_347298() throws Exception { // Y y2 = y; // X x = y2; // } + @Test public void testReferenceToCopyConstructor() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); ICPPASTFunctionDefinition fdef = getDeclaration(tu, 2); @@ -10605,6 +11102,7 @@ public void testReferenceToCopyConstructor() throws Exception { // void xx() { // MyCallback x= MyCallback(&Foo::Method); // Invalid overload of 'Foo::Method' // } + @Test public void testTypedefAsClassNameWithFunctionPtrArgument_350345() throws Exception { parseAndCheckBindings(); } @@ -10622,6 +11120,7 @@ public void testTypedefAsClassNameWithFunctionPtrArgument_350345() throws Except // void f2(int (x), int y=x) { // x= 1; // } + @Test public void testAmbiguityResolution_354599() throws Exception { parseAndCheckBindings(); } @@ -10643,6 +11142,7 @@ public void testAmbiguityResolution_354599() throws Exception { // C c; // c.method(b); // } + @Test public void testAmbiguityResolution_356268() throws Exception { parseAndCheckBindings(); } @@ -10650,6 +11150,7 @@ public void testAmbiguityResolution_356268() throws Exception { // void (g)(char); // void (g)(int); //1 // void (g)(int); //2 + @Test public void testFunctionRedeclarations() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IFunction g1 = bh.assertNonProblem("g)(char)", 1); @@ -10665,12 +11166,14 @@ public void testFunctionRedeclarations() throws Exception { // int r = 12; // return r; // } + @Test public void testVariableDeclarationInIfStatement() throws Exception { parseAndCheckBindings(); } // class A : A { // }; + @Test public void testRecursiveClassInheritance_357256() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPClassType c = bh.assertNonProblem("A", 1); @@ -10685,6 +11188,7 @@ public void testRecursiveClassInheritance_357256() throws Exception { // }; // template<> struct CT2 { // Accessed before ambiguity is resolved // }; + @Test public void testAmbiguityResolution_359364() throws Exception { parseAndCheckBindings(); } @@ -10705,6 +11209,7 @@ public void testAmbiguityResolution_359364() throws Exception { // template<> // struct B { // }; + @Test public void testAmbiguityResolution_427854() throws Exception { parseAndCheckBindings(); } @@ -10716,6 +11221,7 @@ public void testAmbiguityResolution_427854() throws Exception { // T(); // ~T(); // }; + @Test public void testErrorForDestructorWithWrongName_367590() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.STD, false); IASTCompositeTypeSpecifier S; @@ -10745,6 +11251,7 @@ public void testErrorForDestructorWithWrongName_367590() throws Exception { // f(i64); // f(word); // } + @Test public void testModeAttribute_330635() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); String[] calls = { "f(i8)", "f(i16)", "f(i32)", "f(i64)", "f(word)" }; @@ -10754,18 +11261,19 @@ public void testModeAttribute_330635() throws Exception { } for (int i = 0; i < functions.length - 1; i++) { for (int j = 0; j < i; j++) { - assertNotSame(calls[i] + " and " + calls[j] + " resolve to the same function", functions[i], - functions[j]); + assertNotSame(functions[i], functions[j], + calls[i] + " and " + calls[j] + " resolve to the same function"); } } - assertSame(calls[calls.length - 1] + " and " + calls[calls.length - 2] + " resolve to different functions", - functions[calls.length - 1], functions[calls.length - 2]); + assertSame(functions[calls.length - 1], functions[calls.length - 2], + calls[calls.length - 1] + " and " + calls[calls.length - 2] + " resolve to different functions"); } // void f(int x) try { // } catch(...) { // (void)x; // } + @Test public void testParentScopeOfCatchHandler_376246() throws Exception { parseAndCheckBindings(); } @@ -10775,6 +11283,7 @@ public void testParentScopeOfCatchHandler_376246() throws Exception { // void doSomething() throw(MyException); // }; // void MyClass::doSomething() throw (MyException) {} + @Test public void testScopeOfExceptionSpecification_377457() throws Exception { parseAndCheckBindings(); } @@ -10814,6 +11323,7 @@ public void testScopeOfExceptionSpecification_377457() throws Exception { // h( nullptr ); // deduces T = nullptr_t // h( (float*) nullptr ); // deduces T = float* // } + @Test public void testNullptr_327298a() throws Exception { parseAndCheckBindings(); } @@ -10832,6 +11342,7 @@ public void testNullptr_327298a() throws Exception { // void testtemplates() { // g( nullptr ); // error // } + @Test public void testNullptr_327298b() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertProblem("checkNullPtr(1)", 12); @@ -10845,6 +11356,7 @@ public void testNullptr_327298b() throws Exception { // f( nullptr ); // calls f( char* ) // f( 0 ); // calls f( int ) // } + @Test public void testNullptr_327298c() throws Exception { parseAndCheckBindings(); BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); @@ -10855,6 +11367,7 @@ public void testNullptr_327298c() throws Exception { } // void foo(struct S s); + @Test public void testParameterForwardDeclaration_379511() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPClassType struct = bh.assertNonProblem("S", 1, ICPPClassType.class); @@ -10867,6 +11380,7 @@ public void testParameterForwardDeclaration_379511() throws Exception { // struct S { // friend F; // }; + @Test public void testFriendClass() throws Exception { parseAndCheckBindings(); } @@ -10876,6 +11390,7 @@ public void testFriendClass() throws Exception { // struct S { // friend T; // }; + @Test public void testFriendTypedef() throws Exception { parseAndCheckBindings(); } @@ -10884,6 +11399,7 @@ public void testFriendTypedef() throws Exception { // struct T { // friend P; // }; + @Test public void testFriendTemplateParameter() throws Exception { parseAndCheckBindings(); } @@ -10897,6 +11413,7 @@ public void testFriendTemplateParameter() throws Exception { // friend foo::foo(); // friend foo::~foo(); // }; + @Test public void testFriendConstructorDestructor_400940() throws Exception { parseAndCheckBindings(); } @@ -10911,6 +11428,7 @@ public void testFriendConstructorDestructor_400940() throws Exception { // void foo() { // Waldo c; // error here // } + @Test public void testFriendClassLookup_512932() throws Exception { parseAndCheckBindings(); } @@ -10919,6 +11437,7 @@ public void testFriendClassLookup_512932() throws Exception { // virtual void mFuncDecl() final; // virtual void mFuncDef() final {} // }; + @Test public void testFinalFunction() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -10949,6 +11468,7 @@ public void testFinalFunction() throws Exception { // void mFuncDecl() override; // void mFuncDef() override {} // }; + @Test public void testOverrideFunction() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -10979,6 +11499,7 @@ public void testOverrideFunction() throws Exception { // void mFuncDecl() final override; // void mFuncDef() final override {} // }; + @Test public void testOverrideFinalFunction() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -11011,6 +11532,7 @@ private void assertVirtualSpecifiers(ICPPASTFunctionDeclarator declarator, boole // }; // struct S final : public Base { // }; + @Test public void testFinalClass() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -11042,6 +11564,7 @@ public void testFinalClass() throws Exception { // S s; // s.foo(1); // } + @Test public void testFinalTemplateMethod() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -11058,6 +11581,7 @@ public void testFinalTemplateMethod() throws Exception { // final = 4; // override = 2; // } + @Test public void testFinalAndOverrideVariables() throws Exception { parseAndCheckBindings(); } @@ -11068,12 +11592,14 @@ public void testFinalAndOverrideVariables() throws Exception { // void foo(struct S final) { // final.i = 23; // } + @Test public void testFinalParameter() throws Exception { parseAndCheckBindings(); } // struct S __final {}; // struct T { void foo() __final; }; + @Test public void testFinalGccExtension_442457() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPClassType s = bh.assertNonProblem("S"); @@ -11091,6 +11617,7 @@ public void testFinalGccExtension_442457() throws Exception { // struct U { // static const bool value = __is_trivially_constructible(S, Args...); // }; + @Test public void testParsingOfGcc5TypeTraitIntrinsics_485713() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU /* use GNU extensions */); } @@ -11103,6 +11630,7 @@ public void testParsingOfGcc5TypeTraitIntrinsics_485713() throws Exception { // bool operator==(S1 a, int r ); // static const int x = sizeof(CT((TD * (CT::*)) 0)); // template bool operator==(S1 a, const CT& r); + @Test public void testOrderInAmbiguityResolution_390759() throws Exception { parseAndCheckBindings(); } @@ -11118,6 +11646,7 @@ public void testOrderInAmbiguityResolution_390759() throws Exception { // int main() { // bar(N::A); // } + @Test public void testADLForFunctionObject_388287() throws Exception { parseAndCheckBindings(); } @@ -11145,6 +11674,7 @@ public void testADLForFunctionObject_388287() throws Exception { // foo(outer::waldo{}); // foo(outer::E{}); // } + @Test public void testADL_485710() throws Exception { parseAndCheckBindings(); } @@ -11157,6 +11687,7 @@ public void testADL_485710() throws Exception { // struct S {}; // const bool b = __is_base_of(S, int); // typedef A::type T; + @Test public void testIsBaseOf_395019() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11195,6 +11726,7 @@ public void testIsBaseOf_395019() throws Exception { // using Waldo = B; // // Waldo c; + @Test public void testIsBaseOf_446094() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11261,6 +11793,7 @@ public void testIsBaseOf_446094() throws Exception { // fint({vbool}); // fint({vchar}); // } + @Test public void testNarrowingConversionsInListInitialization_389782() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -11297,6 +11830,7 @@ public void testNarrowingConversionsInListInitialization_389782() throws Excepti // void test() { // waldo({1}); // } + @Test public void testNarrowingConversionInListInitialization_491748() throws Exception { parseAndCheckBindings(); } @@ -11334,6 +11868,7 @@ public void testNarrowingConversionInListInitialization_491748() throws Exceptio // std::string fine2(int i) { // return i ? "a" : "b"; // } + @Test public void testThrowExpressionInConditional_396663() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11347,6 +11882,7 @@ public void testThrowExpressionInConditional_396663() throws Exception { // int main() { // foo(true ? new A() : new B()); // } + @Test public void testBasePointerConverstionInConditional_462705() throws Exception { parseAndCheckBindings(); } @@ -11358,6 +11894,7 @@ public void testBasePointerConverstionInConditional_462705() throws Exception { // int main() { // waldo(false ? s : 0); // } + @Test public void testTypedefOfPointerInConditional_481078() throws Exception { parseAndCheckBindings(); } @@ -11372,6 +11909,7 @@ public void testTypedefOfPointerInConditional_481078() throws Exception { // struct base {}; // struct derived : base {}; // typedef enable_if<__is_base_of(base, derived)>::type T; + @Test public void testIsBaseOf_399353() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11380,6 +11918,7 @@ public void testIsBaseOf_399353() throws Exception { // struct derived : base {}; // typedef derived derived2; // const bool value = __is_base_of(base, derived2); + @Test public void testIsBaseOf_409100() throws Exception { BindingAssertionHelper b = getAssertionHelper(); IVariable var = b.assertNonProblem("value"); @@ -11391,6 +11930,7 @@ public void testIsBaseOf_409100() throws Exception { // class Inner {}; // }; // } + @Test public void testNestedClassScopeInlineDefinition_401661() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -11409,6 +11949,7 @@ public void testNestedClassScopeInlineDefinition_401661() throws Exception { // }; // } // class NS::Enclosing::Inner{}; + @Test public void testNestedClassScopeSeparateDefinition_401661() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -11424,6 +11965,7 @@ public void testNestedClassScopeSeparateDefinition_401661() throws Exception { // namespace NS { // class Inner {}; // } + @Test public void testClassScopeInlineDefinition_401661() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -11440,6 +11982,7 @@ public void testClassScopeInlineDefinition_401661() throws Exception { // class Inner; // } // class NS::Inner{}; + @Test public void testClassScopeSeparateDefinition_401661() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -11468,6 +12011,7 @@ public void testClassScopeSeparateDefinition_401661() throws Exception { // void privateMemberFunction(); // class privateNestedClass {}; // }; + @Test public void testMemberAccessibilities() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -11508,6 +12052,7 @@ public void testMemberAccessibilities() throws Exception { // __sync_val_compare_and_swap(&i, 1, 2); // __sync_synchronize(); // } + @Test public void testGNUSyncBuiltins_389578() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11517,6 +12062,7 @@ public void testGNUSyncBuiltins_389578() throws Exception { // __sync_bool_compare_and_swap(&p, p, p); // __sync_fetch_and_add(&p, p, 2); // } + @Test public void testGNUSyncBuiltinsOnVoidPtr_533822() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11530,6 +12076,7 @@ public void testGNUSyncBuiltinsOnVoidPtr_533822() throws Exception { // int __int128_t; // int __uint128_t; // } + @Test public void testGCCIntBuiltins_444577() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11558,6 +12105,7 @@ public void testGCCIntBuiltins_444577() throws Exception { // typedef underlying_type::type int_type; // typedef underlying_type::type ulong_type; // typedef underlying_type::type loong_type; + @Test public void testUnderlyingTypeBuiltin_411196() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -11578,6 +12126,7 @@ public void testUnderlyingTypeBuiltin_411196() throws Exception { // }; // enum class E : short {}; // using target = underlying_type::type; + @Test public void testUnderlyingType_548954() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); assertSameType((ITypedef) helper.assertNonProblem("target"), CPPBasicType.SHORT); @@ -11596,6 +12145,7 @@ public void testUnderlyingType_548954() throws Exception { // void test() { // bar(2); // } + @Test public void testUnderlyingType_540909() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU /* use GNU extensions */); } @@ -11609,6 +12159,7 @@ public void testUnderlyingType_540909() throws Exception { // void foo() { // bar('a'); // Invalid arguments 'Candidates are: void bar(@120932903)' // } + @Test public void testUnderlyingType_568625() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU /* use GNU extensions */); } @@ -11621,6 +12172,7 @@ public void testUnderlyingType_568625() throws Exception { // intFunc(__builtin_expect(i, 0)); // ptrFunc(__builtin_return_address(4)); // } + @Test public void testGCCBuiltins_512932a() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -11634,6 +12186,7 @@ public void testGCCBuiltins_512932a() throws Exception { // intFunc(__builtin_expect(pI, (int*)0)); // ptrFunc(__builtin_expect(i, 0)); // } + @Test public void testGCCBuiltins_512932b() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertProblem("__builtin_assume_aligned", "__builtin_assume_aligned"); @@ -11655,6 +12208,7 @@ public void testGCCBuiltins_512932b() throws Exception { // } // } // } + @Test public void testQualifiedNameLookup() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); @@ -11701,6 +12255,7 @@ public void testQualifiedNameLookup() throws Exception { // test(*a); // } // }; + @Test public void testBuiltInOperator_423396() throws Exception { parseAndCheckBindings(); } @@ -11714,6 +12269,7 @@ public void testBuiltInOperator_423396() throws Exception { // test(*a); // } // }; + @Test public void testBuiltInOperatorFunctionType_423396() throws Exception { parseAndCheckBindings(); } @@ -11723,6 +12279,7 @@ public void testBuiltInOperatorFunctionType_423396() throws Exception { // void foo() { // waldo(__FUNCTION__); // } + @Test public void testTypeOfBuiltinSymbol_512932() throws Exception { parseAndCheckBindings(); } @@ -11735,6 +12292,7 @@ public void testTypeOfBuiltinSymbol_512932() throws Exception { // S s; // tint(s.S); // } + @Test public void testFieldWithSameNameAsClass_326750() throws Exception { parseAndCheckBindings(); } @@ -11744,11 +12302,13 @@ public void testFieldWithSameNameAsClass_326750() throws Exception { // int main() { // waldo([](){}); // } + @Test public void testConversionFromLambdaToFunctionPointer_424765() throws Exception { parseAndCheckBindings(); } // void bar(void *a1, void *a2) __attribute__((nonnull(1, 2))); + @Test public void testGCCAttributeSequence_416430() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); IASTDeclaration[] declarations = tu.getDeclarations(); @@ -11782,11 +12342,13 @@ public void testGCCAttributeSequence_416430() throws Exception { // struct MyStruct::Inner in; // in.waldo; // } + @Test public void testFieldAndNestedTypeWithSameName_425033() throws Exception { parseAndCheckBindings(); } // void f(double (&(x))); + @Test public void testParenthesizedReferenceArgument_424898() throws Exception { parseAndCheckBindings(); } @@ -11798,6 +12360,7 @@ public void testParenthesizedReferenceArgument_424898() throws Exception { // } // // constexpr int waldo = naive_fibonacci(5); + @Test public void testConditionalExpressionFolding_429891() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable waldo = helper.assertNonProblem("waldo"); @@ -11811,6 +12374,7 @@ public void testConditionalExpressionFolding_429891() throws Exception { // } // // constexpr int waldo = naive_fibonacci(50); + @Test public void testConstexprEvaluationLimit_429891() throws Exception { // Here we're just checking that the computation of the initial // value finishes (with a null result) in a reasonable time. @@ -11825,6 +12389,7 @@ public void testConstexprEvaluationLimit_429891() throws Exception { // return a; // } // constexpr int waldo = foo(); + @Test public void testNameLookupInDefaultArgument_432701() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable waldo = helper.assertNonProblem("waldo"); @@ -11838,6 +12403,7 @@ public void testNameLookupInDefaultArgument_432701() throws Exception { // S1(42); // s2(43); // } + @Test public void testICPPASTFunctionCallExpression_getOverload_441701() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -11851,6 +12417,7 @@ public void testICPPASTFunctionCallExpression_getOverload_441701() throws Except } // void f(int &&a); + @Test public void testRValueReferenceSignature_427856() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); IASTSimpleDeclaration sd = (IASTSimpleDeclaration) tu.getDeclarations()[0]; @@ -11863,12 +12430,14 @@ public void testRValueReferenceSignature_427856() throws Exception { // int waldo = 42; // find(waldo); // } + @Test public void testRValueReferenceBindingToTemporary_470943() throws Exception { parseAndCheckBindings(); } // constexpr int waldo1 = 42; // constexpr auto waldo2 = 43; + @Test public void testConstexprVariableIsConst_451091() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPVariable waldo1 = helper.assertNonProblem("waldo1"); @@ -11879,6 +12448,7 @@ public void testConstexprVariableIsConst_451091() throws Exception { } // constexpr int* waldo; + @Test public void testConstexprPointerVariable_541670() throws Exception { getAssertionHelper().assertVariableType("waldo", CommonCPPTypes.constPointerToInt); } @@ -11886,6 +12456,7 @@ public void testConstexprPointerVariable_541670() throws Exception { // constexpr int waldo1(); // constexpr int (*waldo2())(int); // struct S { constexpr int waldo3(); }; + @Test public void testTypeOfConstexprFunction_451090() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPFunction waldo1 = helper.assertNonProblem("waldo1"); @@ -11900,12 +12471,14 @@ public void testTypeOfConstexprFunction_451090() throws Exception { } // void waldo() noexcept; + @Test public void testASTCopyForNoexceptDefault_bug456207() throws Exception { parseAndCheckBindings(); } // template struct waldo { waldo(int); }; // auto x = static_cast>(0); + @Test public void testTemplateIdInsideCastOperator_460080() throws Exception { parseAndCheckBindings(); } @@ -11928,17 +12501,20 @@ public void testTemplateIdInsideCastOperator_460080() throws Exception { // struct Y { // alignas(N...) char x; // }; + @Test public void testAlignas_451082() throws Exception { parseAndCheckBindings(); } // struct alignas(16) Node {}; // enum alignas(8) E { E1, E2 }; + @Test public void testAlignas_475739() throws Exception { parseAndCheckBindings(); } // __attribute__((section(".example"))) alignas(4) static int waldo; + @Test public void testAlignasAfterAttribute_538615() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU /* use GNU extensions */); } @@ -11946,6 +12522,7 @@ public void testAlignasAfterAttribute_538615() throws Exception { // int var1 alignas(16); // int var2 __attribute__((section(".example"))) alignas(16); // int var3 alignas(16) __attribute__((section(".example"))); + @Test public void testAlignaAsAfterDeclarator() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU /* use GNU extensions */); } @@ -11958,6 +12535,7 @@ public void testAlignaAsAfterDeclarator() throws Exception { // int operator "" _F(const char32_t* s, unsigned int sz) { return sz; } // int operator "" _G(char c) { return (int)c; } // constexpr double operator "" _km_to_miles(long double km) { return km * 0.6213; } + @Test public void testSimpleUserDefinedLiteralOperators() throws Exception { parseAndCheckBindings(); } @@ -11994,6 +12572,7 @@ public void testSimpleUserDefinedLiteralOperators() throws Exception { // 01_suff, // 1ULL << 34, // }; + @Test public void testIntegerUserDefinedLiterals() throws Exception { parseAndCheckBindings(); } @@ -12007,6 +12586,7 @@ public void testIntegerUserDefinedLiterals() throws Exception { // 0x01p3XX, // 1._X // }; + @Test public void testDoublesUserDefinedLiterals() throws Exception { parseAndCheckBindings(); } @@ -12015,6 +12595,7 @@ public void testDoublesUserDefinedLiterals() throws Exception { // char c2 = '0'suff; // char* c3 = "Hello"_suff; // char* c4 = "Hello"suff; + @Test public void testCharStringUserDefinedLiterals() throws Exception { parseAndCheckBindings(); } @@ -12022,6 +12603,7 @@ public void testCharStringUserDefinedLiterals() throws Exception { // class Ret {}; // Ret operator "" _X(unsigned long long i) { return Ret(); } // auto test = 123_X; + @Test public void testUserDefinedLiteralOperatorTypes1() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12029,6 +12611,7 @@ public void testUserDefinedLiteralOperatorTypes1() throws Exception { // class Ret {}; // Ret operator "" _X(long double i) { return Ret(); } // auto test = 12.3_X; + @Test public void testUserDefinedLiteralOperatorTypes2() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12036,6 +12619,7 @@ public void testUserDefinedLiteralOperatorTypes2() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s) { return Ret(); } // auto test = 123_X; + @Test public void testUserDefinedLiteralOperatorTypes1a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12043,6 +12627,7 @@ public void testUserDefinedLiteralOperatorTypes1a() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s) { return Ret(); } // auto test = 12.3_X; + @Test public void testUserDefinedLiteralOperatorTypes2a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12051,6 +12636,7 @@ public void testUserDefinedLiteralOperatorTypes2a() throws Exception { // Ret operator "" _X(unsigned long long d) { return Ret(); } // bool operator "" _X(const char* s) { return false; } // auto test = 123_X; + @Test public void testUserDefinedLiteralOperatorTypes1b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12059,6 +12645,7 @@ public void testUserDefinedLiteralOperatorTypes1b() throws Exception { // Ret operator "" _X(long double d) { return Ret(); } // bool operator "" _X(const char* s) { return false; } // auto test = 12.3_X; + @Test public void testUserDefinedLiteralOperatorTypes2b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12066,6 +12653,7 @@ public void testUserDefinedLiteralOperatorTypes2b() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // auto test = "123"_X; + @Test public void testUserDefinedLiteralOperatorTypes3() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12073,6 +12661,7 @@ public void testUserDefinedLiteralOperatorTypes3() throws Exception { // class Ret {}; // Ret operator "" _X(const wchar_t* s, unsigned sz) { return Ret(); } // auto test = L"123"_X; + @Test public void testUserDefinedLiteralOperatorTypes3a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12080,6 +12669,7 @@ public void testUserDefinedLiteralOperatorTypes3a() throws Exception { // class Ret {}; // Ret operator "" _X(const char16_t* s, unsigned sz) { return Ret(); } // auto test = u"123"_X; + @Test public void testUserDefinedLiteralOperatorTypes3b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12087,6 +12677,7 @@ public void testUserDefinedLiteralOperatorTypes3b() throws Exception { // class Ret {}; // Ret operator "" _X(const char32_t* s, unsigned sz) { return Ret(); } // auto test = U"123"_X; + @Test public void testUserDefinedLiteralOperatorTypes3c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12094,6 +12685,7 @@ public void testUserDefinedLiteralOperatorTypes3c() throws Exception { // class Ret {}; // template Ret operator "" _X() { return Ret(); } // auto test = 123_X; + @Test public void testUserDefinedLiteralOperatorTypes4a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12101,6 +12693,7 @@ public void testUserDefinedLiteralOperatorTypes4a() throws Exception { // class Ret {}; // template Ret operator "" _X() { return Ret(); } // auto test = 123.123_X; + @Test public void testUserDefinedLiteralOperatorTypes4b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12108,6 +12701,7 @@ public void testUserDefinedLiteralOperatorTypes4b() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // auto test = "123" "123"_X; + @Test public void testUserDefinedLiteralConcatenation1a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12115,6 +12709,7 @@ public void testUserDefinedLiteralConcatenation1a() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // auto test = "123"_X "123"; + @Test public void testUserDefinedLiteralConcatenation1b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12122,6 +12717,7 @@ public void testUserDefinedLiteralConcatenation1b() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // auto test = u8"123" "123"_X; + @Test public void testUserDefinedLiteralConcatenation2a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12129,6 +12725,7 @@ public void testUserDefinedLiteralConcatenation2a() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // auto test = u8"123"_X "123"; + @Test public void testUserDefinedLiteralConcatenation2b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12136,6 +12733,7 @@ public void testUserDefinedLiteralConcatenation2b() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // auto test = "123" u8"123"_X; + @Test public void testUserDefinedLiteralConcatenation2c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12143,6 +12741,7 @@ public void testUserDefinedLiteralConcatenation2c() throws Exception { // class Ret {}; // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // auto test = "123"_X u8"123"; + @Test public void testUserDefinedLiteralConcatenation2d() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12150,6 +12749,7 @@ public void testUserDefinedLiteralConcatenation2d() throws Exception { // class Ret {}; // Ret operator "" _X(const wchar_t* s, unsigned sz) { return Ret(); } // auto test = L"123" "123"_X; + @Test public void testUserDefinedLiteralConcatenation3a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12157,6 +12757,7 @@ public void testUserDefinedLiteralConcatenation3a() throws Exception { // class Ret {}; // Ret operator "" _X(const wchar_t* s, unsigned sz) { return Ret(); } // auto test = L"123"_X "123"; + @Test public void testUserDefinedLiteralConcatenation3b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12164,6 +12765,7 @@ public void testUserDefinedLiteralConcatenation3b() throws Exception { // class Ret {}; // Ret operator "" _X(const wchar_t* s, unsigned sz) { return Ret(); } // auto test = "123" L"123"_X; + @Test public void testUserDefinedLiteralConcatenation3c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12171,6 +12773,7 @@ public void testUserDefinedLiteralConcatenation3c() throws Exception { // class Ret {}; // Ret operator "" _X(const wchar_t* s, unsigned sz) { return Ret(); } // auto test = "123"_X L"123"; + @Test public void testUserDefinedLiteralConcatenation3d() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12178,6 +12781,7 @@ public void testUserDefinedLiteralConcatenation3d() throws Exception { // class Ret {}; // Ret operator "" _X(const char16_t* s, unsigned sz) { return Ret(); } // auto test = u"123" "123"_X; + @Test public void testUserDefinedLiteralConcatenation4a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12185,6 +12789,7 @@ public void testUserDefinedLiteralConcatenation4a() throws Exception { // class Ret {}; // Ret operator "" _X(const char16_t* s, unsigned sz) { return Ret(); } // auto test = u"123"_X "123"; + @Test public void testUserDefinedLiteralConcatenation4b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12192,6 +12797,7 @@ public void testUserDefinedLiteralConcatenation4b() throws Exception { // class Ret {}; // Ret operator "" _X(const char16_t* s, unsigned sz) { return Ret(); } // auto test = "123" u"123"_X; + @Test public void testUserDefinedLiteralConcatenation4c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12199,6 +12805,7 @@ public void testUserDefinedLiteralConcatenation4c() throws Exception { // class Ret {}; // Ret operator "" _X(const char16_t* s, unsigned sz) { return Ret(); } // auto test = "123"_X u"123"; + @Test public void testUserDefinedLiteralConcatenation4d() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12206,6 +12813,7 @@ public void testUserDefinedLiteralConcatenation4d() throws Exception { // class Ret {}; // Ret operator "" _X(const char32_t* s, unsigned sz) { return Ret(); } // auto test = U"123" "123"_X; + @Test public void testUserDefinedLiteralConcatenation5a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12213,6 +12821,7 @@ public void testUserDefinedLiteralConcatenation5a() throws Exception { // class Ret {}; // Ret operator "" _X(const char32_t* s, unsigned sz) { return Ret(); } // auto test = U"123"_X "123"; + @Test public void testUserDefinedLiteralConcatenation5b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12220,6 +12829,7 @@ public void testUserDefinedLiteralConcatenation5b() throws Exception { // class Ret {}; // Ret operator "" _X(const char32_t* s, unsigned sz) { return Ret(); } // auto test = "123" U"123"_X; + @Test public void testUserDefinedLiteralConcatenation5c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12227,6 +12837,7 @@ public void testUserDefinedLiteralConcatenation5c() throws Exception { // class Ret {}; // Ret operator "" _X(const char32_t* s, unsigned sz) { return Ret(); } // auto test = "123"_X U"123"; + @Test public void testUserDefinedLiteralConcatenation5d() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12234,6 +12845,7 @@ public void testUserDefinedLiteralConcatenation5d() throws Exception { // class Ret {}; // Ret operator "" _X(const char32_t* s, unsigned sz) { return Ret(); } // auto test = "123"_X U"123"_X; + @Test public void testUserDefinedLiteralConcatenation6() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12241,6 +12853,7 @@ public void testUserDefinedLiteralConcatenation6() throws Exception { // class Ret {}; // Ret operator "" _X(char const * const s, unsigned long sz) { return Ret(); } // auto test = "123"_X; + @Test public void testUserDefinedLiteralConcatenation_528196_1a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12248,6 +12861,7 @@ public void testUserDefinedLiteralConcatenation_528196_1a() throws Exception { // class Ret {}; // Ret operator "" _X(char const * volatile s, unsigned long sz) { return Ret(); } // auto test = "123"_X; + @Test public void testUserDefinedLiteralConcatenation_528196_1b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12255,6 +12869,7 @@ public void testUserDefinedLiteralConcatenation_528196_1b() throws Exception { // class Ret {}; // Ret operator "" _X(char const * const volatile s, unsigned long sz) { return Ret(); } // auto test = "123"_X; + @Test public void testUserDefinedLiteralConcatenation_528196_1c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12262,6 +12877,7 @@ public void testUserDefinedLiteralConcatenation_528196_1c() throws Exception { // class Ret {}; // Ret operator "" _X(char const * s, unsigned long const sz) { return Ret(); } // auto test = "123"_X; + @Test public void testUserDefinedLiteralConcatenation_528196_2a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12269,6 +12885,7 @@ public void testUserDefinedLiteralConcatenation_528196_2a() throws Exception { // class Ret {}; // Ret operator "" _X(char const * s, unsigned long volatile sz) { return Ret(); } // auto test = "123"_X; + @Test public void testUserDefinedLiteralConcatenation_528196_2b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12276,6 +12893,7 @@ public void testUserDefinedLiteralConcatenation_528196_2b() throws Exception { // class Ret {}; // Ret operator "" _X(char const * s, unsigned long const volatile sz) { return Ret(); } // auto test = "123"_X; + @Test public void testUserDefinedLiteralConcatenation_528196_2c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12283,6 +12901,7 @@ public void testUserDefinedLiteralConcatenation_528196_2c() throws Exception { // class Ret {}; // Ret operator "" _X(unsigned long long const) { return Ret(); } // auto test = 10_X; + @Test public void testUserDefinedLiteralConcatenation_528196_3a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12290,6 +12909,7 @@ public void testUserDefinedLiteralConcatenation_528196_3a() throws Exception { // class Ret {}; // Ret operator "" _X(unsigned long long volatile) { return Ret(); } // auto test = 10_X; + @Test public void testUserDefinedLiteralConcatenation_528196_3b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12297,6 +12917,7 @@ public void testUserDefinedLiteralConcatenation_528196_3b() throws Exception { // class Ret {}; // Ret operator "" _X(unsigned long long const volatile) { return Ret(); } // auto test = 10_X; + @Test public void testUserDefinedLiteralConcatenation_528196_3c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12304,6 +12925,7 @@ public void testUserDefinedLiteralConcatenation_528196_3c() throws Exception { // class Ret {}; // Ret operator "" _X(char const) { return Ret(); } // auto test = 'a'_X; + @Test public void testUserDefinedLiteralConcatenation_528196_4a() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12311,6 +12933,7 @@ public void testUserDefinedLiteralConcatenation_528196_4a() throws Exception { // class Ret {}; // Ret operator "" _X(char volatile) { return Ret(); } // auto test = 'a'_X; + @Test public void testUserDefinedLiteralConcatenation_528196_4b() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12318,6 +12941,7 @@ public void testUserDefinedLiteralConcatenation_528196_4b() throws Exception { // class Ret {}; // Ret operator "" _X(char const volatile) { return Ret(); } // auto test = 'a'_X; + @Test public void testUserDefinedLiteralConcatenation_528196_4c() throws Exception { checkUserDefinedLiteralIsRet(getAboveComment()); } @@ -12326,6 +12950,7 @@ public void testUserDefinedLiteralConcatenation_528196_4c() throws Exception { // Ret operator "" _X(const char* s, unsigned sz) { return Ret(); } // Ret operator "" _Y(const char* s, unsigned sz) { return Ret(); } // auto test = "123"_X "123"_Y; + @Test public void testUserDefinedLiteralBadConcatenation1() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, false); @@ -12342,16 +12967,19 @@ public void testUserDefinedLiteralBadConcatenation1() throws Exception { // return basic_string { str, len }; // } // auto waldo = "Waldo"s; + @Test public void testStringLiterals() throws Exception { checkUserDefinedLiteralIsType(getAboveComment(), "basic_string"); } // auto waldo = 1i + 1; + @Test public void testComplexNumbersCompilerSupport1() throws Exception { checkUserDefinedLiteralIsType(getAboveComment(), "_Complex int"); } // auto waldo = 1j + 1; + @Test public void testComplexNumbersCompilerSupport2() throws Exception { checkUserDefinedLiteralIsType(getAboveComment(), "_Complex int"); } @@ -12364,6 +12992,7 @@ public void testComplexNumbersCompilerSupport2() throws Exception { // return complex { 0, imag }; // } // auto waldo = 1i + 1; + @Test public void testComplexNumbersOverriddenCompilerSupport() throws Exception { checkUserDefinedLiteralIsType(getAboveComment(), "complex"); } @@ -12376,6 +13005,7 @@ public void testComplexNumbersOverriddenCompilerSupport() throws Exception { // return complex { 0, imag }; // } // auto waldo = 1.0if + 1; + @Test public void testComplexFloatNumbersOverriddenCompilerSupport() throws Exception { checkUserDefinedLiteralIsType(getAboveComment(), "complex"); } @@ -12383,6 +13013,7 @@ public void testComplexFloatNumbersOverriddenCompilerSupport() throws Exception // // Test name lacking a space // int operator ""X(const char* s) { return 0; } // int operator ""_X(const char* s) { return 0; } + @Test public void testUserDefinedLiteralNoWhiteSpace1() throws Exception { parseAndCheckBindings(); } @@ -12407,6 +13038,7 @@ public void testUserDefinedLiteralNoWhiteSpace1() throws Exception { // auto e4 = u"1" _X "2"; // auto e5 = U"1" _X "2"; // auto d5 = U"1" _X; + @Test public void testUserDefinedLiteralNoWhiteSpace2() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, false); IASTDeclaration[] decls = tu.getDeclarations(); @@ -12423,6 +13055,7 @@ public void testUserDefinedLiteralNoWhiteSpace2() throws Exception { // template RetA operator "" _X() { return RetA(); } // RetB operator "" _X(unsigned long long i) { return RetB(); } // auto a = 123_X; + @Test public void testUserDefinedLiteralResolution1() throws Exception { checkUserDefinedLiteralIsType(getAboveComment(), "RetB"); } @@ -12432,6 +13065,7 @@ public void testUserDefinedLiteralResolution1() throws Exception { // template RetA operator "" _X() { return RetA(); } // RetB operator "" _X(long double i) { return RetB(); } // auto a = 123.123_X; + @Test public void testUserDefinedLiteralResolution2() throws Exception { checkUserDefinedLiteralIsType(getAboveComment(), "RetB"); } @@ -12441,6 +13075,7 @@ public void testUserDefinedLiteralResolution2() throws Exception { // template RetA operator "" _X() { return RetA(); } // RetB operator "" _X(const char * c) { return RetB(); } // auto test = 123_X; + @Test public void testUserDefinedLiteralResolution3() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPVariable test = bh.assertNonProblemOnFirstIdentifier("test"); @@ -12456,6 +13091,7 @@ public void testUserDefinedLiteralResolution3() throws Exception { // using namespace N; // setColor("#ffffff"_color); // ERROR // } + @Test public void testUserDefinedLiteralInNamespace_510665() throws Exception { parseAndCheckBindings(); } @@ -12464,6 +13100,7 @@ public void testUserDefinedLiteralInNamespace_510665() throws Exception { // double waldo2 = 09.268; // double waldo3 = 02e2; // double waldo4 = 09e2; + @Test public void testFloatLiteralWithLeadingZero_498434() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -12471,6 +13108,7 @@ public void testFloatLiteralWithLeadingZero_498434() throws Exception { // char foo() { // return '*'; // } + @Test public void testRegression_484618() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -12488,6 +13126,7 @@ public void testRegression_484618() throws Exception { // #else // 0; // #endif + @Test public void testHasFeature_442325() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("lambdas_supported", 1); @@ -12509,6 +13148,7 @@ public void testHasFeature_442325() throws Exception { // int c[6] = { [4] = 29, [2] = 15 }; // int d[6] = { [2 ... 4] = 29 }; // } + @Test public void testDesignatedInitializers() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); // ICPPASTDesignatedInitializer d1 = bh.assertNode(".a = 10"); @@ -12562,6 +13202,7 @@ public void testDesignatedInitializers() throws Exception { // struct F : D, virtual E { // F() {} // }; + @Test public void testImplicitlyCalledBaseConstructor_393717() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -12599,6 +13240,7 @@ public void testImplicitlyCalledBaseConstructor_393717() throws Exception { // int main() { // a(A{3, 4}); // } + @Test public void testImplicitConstructorNameInTypeConstructorExpression_447431() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPConstructor ctor = helper.assertNonProblem("A(int, int)", "A"); @@ -12617,6 +13259,7 @@ public void testImplicitConstructorNameInTypeConstructorExpression_447431() thro // using Waldo = Waldo; // auto size = sizeof(Waldo::x); // } + @Test public void testShadowingAliasDeclaration_484200() throws Exception { parseAndCheckBindings(); } @@ -12628,6 +13271,7 @@ public void testShadowingAliasDeclaration_484200() throws Exception { // return Zero == 0; // "Symbol 'Zero' could not be resolved" // } // }; + @Test public void testAnonymousEnumInAliasDeclaration_502016() throws Exception { parseAndCheckBindings(); } @@ -12639,6 +13283,7 @@ public void testAnonymousEnumInAliasDeclaration_502016() throws Exception { // enum class E { A }; // void bar(E); // }; + @Test public void testEnumDeclaredLaterInClass_491747() throws Exception { parseAndCheckBindings(); } @@ -12648,6 +13293,7 @@ public void testEnumDeclaredLaterInClass_491747() throws Exception { // return 5; // } // constexpr int waldo = A + A; + @Test public void testOverloadedOperatorWithEnumArgument_506672() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("waldo", 5); @@ -12657,6 +13303,7 @@ public void testOverloadedOperatorWithEnumArgument_506672() throws Exception { // static S waldo; // }; // void foo(const S& = S()); + @Test public void testValueRepresentationOfClassWithStaticMemberOfOwnType_490475() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPFunction foo = helper.assertNonProblem("foo"); @@ -12668,6 +13315,7 @@ public void testValueRepresentationOfClassWithStaticMemberOfOwnType_490475() thr // S waldo; // invalid // }; // void foo(const S& = S()); + @Test public void testClassDirectlyAggregatingItself_490475() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPFunction foo = helper.assertNonProblem("foo"); @@ -12683,6 +13331,7 @@ public void testClassDirectlyAggregatingItself_490475() throws Exception { // S waldo; // }; // void foo(const T& = T()); + @Test public void testClassIndirectlyAggregatingItself_490475() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPFunction foo = helper.assertNonProblem("foo"); @@ -12709,6 +13358,7 @@ public void testClassIndirectlyAggregatingItself_490475() throws Exception { // decltype(auto) const m = 42; // Error - decltype(auto) does not allow type specifiers. Bug 527553 // decltype(auto) volatile n = 42; // Error - decltype(auto) does not allow type specifiers. Bug 527553 // decltype(auto) const volatile o = 42; // Error - decltype(auto) does not allow type specifiers. Bug 527553 + @Test public void testDecltypeAutoVariableTypes_482225() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -12765,6 +13415,7 @@ public void testDecltypeAutoVariableTypes_482225() throws Exception { // return 23.0; // } // auto a = foo(); + @Test public void testDecltypeAutoTrailingReturnTypeConst_527553() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -12777,6 +13428,7 @@ public void testDecltypeAutoTrailingReturnTypeConst_527553() throws Exception { // return 23.0; // } // auto a = foo(); + @Test public void testDecltypeAutoTrailingReturnTypeVolatile_527553() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -12789,6 +13441,7 @@ public void testDecltypeAutoTrailingReturnTypeVolatile_527553() throws Exception // return 23.0; // } // decltype(auto) a = foo(); + @Test public void testDecltypeAutoTrailingReturnTypeConstDecltype_527553() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -12800,6 +13453,7 @@ public void testDecltypeAutoTrailingReturnTypeConstDecltype_527553() throws Exce // auto foo() -> decltype(auto) { // return 23.0; // } + @Test public void testDecltypeAutoTrailingReturnType_482225() throws Exception { parseAndCheckBindings(); } @@ -12807,6 +13461,7 @@ public void testDecltypeAutoTrailingReturnType_482225() throws Exception { // decltype(auto) foo() { // return 23.0; // } + @Test public void testDecltypeAutoReturnType_482225() throws Exception { parseAndCheckBindings(); } @@ -12819,11 +13474,13 @@ public void testDecltypeAutoReturnType_482225() throws Exception { // Waldo w; // auto i1 = w, i2 = i1.foo(); // Error on 'foo' // } + @Test public void testAutoWithTwoDeclarators_522066() throws Exception { parseAndCheckBindings(); } // constexpr int waldo = (sizeof(double) % 16); + @Test public void testSizeofDouble_506170() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("waldo", 8); @@ -12838,6 +13495,7 @@ public void testSizeofDouble_506170() throws Exception { // bc || bc; // !bc; // } + @Test public void testContextualBooleanConversion_506972() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); IASTDeclaration explicitBooleanContextsFunction = tu.getDeclarations()[1]; @@ -12872,11 +13530,13 @@ public void testContextualBooleanConversion_506972() throws Exception { // el0 __attribute__((deprecated)), // el1, // }; + @Test public void testEnumeratorAttribute_514821() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU /* use GNU extensions */); } // void foo([[maybe_unused]] int a); + @Test public void testCxx11AttributeBeforeParameterDeclaration_530729() throws Exception { parseAndCheckBindings(); } @@ -12891,6 +13551,7 @@ public void testCxx11AttributeBeforeParameterDeclaration_530729() throws Excepti // char name[sizeof(CType().m_Array)]; // foo(name); // } + @Test public void testSizeofArrayField_512932() throws Exception { parseAndCheckBindings(); } @@ -12911,6 +13572,7 @@ public void testSizeofArrayField_512932() throws Exception { // //TestNameSpace::TestNameSpace() { //} + @Test public void testUsingDirectiveNamespaceWithPreviousFunctionName_517402() throws Exception { parseAndCheckBindings(); } @@ -12929,6 +13591,7 @@ public void testUsingDirectiveNamespaceWithPreviousFunctionName_517402() throws //namespace ns12 = ns2; //ns12::TestNameSpace::TestNameSpace() { //} + @Test public void testNamespaceAliasNamespaceWithPreviousFunctionName_517402() throws Exception { parseAndCheckBindings(); } @@ -12936,6 +13599,7 @@ public void testNamespaceAliasNamespaceWithPreviousFunctionName_517402() throws // class C {}; // typedef C D; // constexpr bool waldo = __is_class(D); + @Test public void testIsClassBuiltinOnTypedef_522509() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("waldo", 1); @@ -12943,6 +13607,7 @@ public void testIsClassBuiltinOnTypedef_522509() throws Exception { // struct A {}; // struct A* b = (1 == 1) ? new struct A : new struct A; + @Test public void test_ElabTypeSpecInNewExprInConditional_526134() throws Exception { parseAndCheckBindings(); } @@ -12953,6 +13618,7 @@ public void test_ElabTypeSpecInNewExprInConditional_526134() throws Exception { // constexpr bool waldo3 = __is_trivially_constructible(S, const S&); // constexpr bool waldo4 = __is_trivially_constructible(S, int); // constexpr bool waldo5 = __is_trivially_constructible(S, const S&, float); + @Test public void testIsTriviallyConstructible_528072() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("waldo1", 1); @@ -12969,12 +13635,14 @@ public void testIsTriviallyConstructible_528072() throws Exception { // }; // // constexpr bool waldo = __is_constructible(pair, pair&&); + @Test public void testIsConstructible_539052() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("waldo", 1); } // constexpr bool waldo = unsigned(-1) < unsigned(0); + @Test public void testNegativeCastToUnsigned_544509() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("waldo", 0); @@ -12989,6 +13657,7 @@ public void testNegativeCastToUnsigned_544509() throws Exception { // constexpr short short_from_negative_long = -((1L << 32) + 1); // constexpr unsigned int uint_from_negative_long = -((1L << 32) + 1); // constexpr unsigned short ushort_from_negative_long = -((1L << 32) + 1); + @Test public void testIntegerImplicitConversions() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -13009,6 +13678,7 @@ public void testIntegerImplicitConversions() throws Exception { // constexpr bool bool_from_int_expr = int(0x100000001L) < 2; // constexpr bool bool_from_short_expr = short(0x100010001L) < 2; // constexpr int int_from_cast_to_int = (int)((1L << 32) + 1); + @Test public void testIntegerTrunctatingConversions() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("bool_from_int_positive", 1); @@ -13027,6 +13697,7 @@ public void testIntegerTrunctatingConversions() throws Exception { // constexpr unsigned int uint_from_uint_literal_negation = -(1U); // constexpr unsigned int uint_from_uint_cast_negation = -(1U); // constexpr unsigned short ushort_from_ushort_cast_negation = -((unsigned short)1); + @Test public void testUnsignedIntegerUnaryMinus() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); @@ -13051,6 +13722,7 @@ public void testUnsignedIntegerUnaryMinus() throws Exception { // int main() { // x::y::bar(); // } + @Test public void testNestedNamespaceDefinition_490359() throws Exception { parseAndCheckBindings(); } @@ -13062,6 +13734,7 @@ public void testNestedNamespaceDefinition_490359() throws Exception { // auto v_a = 1'123'456ul; // auto v_b = 1'123'456ull; // auto v_c = 0xAABB'CCDDll; + @Test public void testLiteralDecimalSeparators_519062() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("l_a", 804); @@ -13078,6 +13751,7 @@ public void testLiteralDecimalSeparators_519062() throws Exception { // extern void *List[]; // void *List[] = { 0 }; // unsigned int ListSize = sizeof(List)/sizeof(List[0]); + @Test public void testMultipleExternDecls_534098() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable var = helper.assertNonProblem("ListSize"); @@ -13087,6 +13761,7 @@ public void testMultipleExternDecls_534098() throws Exception { } //static_assert(true); + @Test public void testStaticAssertWithoutMessage_534808() throws Exception { parseAndCheckBindings(); } @@ -13098,6 +13773,7 @@ public void testStaticAssertWithoutMessage_534808() throws Exception { // auto myFunA() -> struct MyStruct { // return {5}; // }; + @Test public void testElabSpecInTrailingReturn_535777() throws Exception { parseAndCheckBindings(); } @@ -13114,6 +13790,7 @@ public void testElabSpecInTrailingReturn_535777() throws Exception { // type a4{1,2,3}; // type a5 = {1,2,3}; // } + @Test public void testInitListConstructor_542448() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("a0", 2, CPPConstructor.class); @@ -13134,6 +13811,7 @@ public void testInitListConstructor_542448() throws Exception { // type a1{1,2}; // ok // type a2 = {1,2}; // error: using explict ctor // } + @Test public void testInitListConstructorWithExplicit_542448() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("a0", 2, CPPConstructor.class); @@ -13148,6 +13826,7 @@ public void testInitListConstructorWithExplicit_542448() throws Exception { // int main() { // type a0 = {1,2}; // } + @Test public void testInitListConstructorWithExplicit2_542448() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); // ill-formed, because overload resolution @@ -13166,6 +13845,7 @@ public void testInitListConstructorWithExplicit2_542448() throws Exception { // }; // // A a{1, 3, 5, 6}; + @Test public void testInitListConstRef_549035() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13181,6 +13861,7 @@ public void testInitListConstRef_549035() throws Exception { // type{1, 2}; // type(other_type()); // } + @Test public void testCtorWithWrongArguments_543913() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("type(1, 2)", 4, IProblemBinding.class); @@ -13201,6 +13882,7 @@ public void testCtorWithWrongArguments_543913() throws Exception { // foo({1}); // foo({{1}}); // } + @Test public void testBraceElisionForAggregateInit0_SimpleValid_543038() throws Exception { parseAndCheckBindings(); } @@ -13218,6 +13900,7 @@ public void testBraceElisionForAggregateInit0_SimpleValid_543038() throws Except // foo({1,2}); // foo({{1,2}}); // } + @Test public void testBraceElisionForAggregateInit1_SimpleTooManyInitializers_543038() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("array{{1,2}}", 5, IProblemBinding.class); @@ -13251,6 +13934,7 @@ public void testBraceElisionForAggregateInit1_SimpleTooManyInitializers_543038() // level1{1,2}; // ERROR: calling level1 constructor, not aggregate init of level0 // foo({{{1,2,3}}}); // ERROR: not aggregate init // } + @Test public void testBraceElisionForAggregateInit2_WithNonAggregate_543038() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("foo({level1{{1,2}}})", 3); @@ -13272,6 +13956,7 @@ public void testBraceElisionForAggregateInit2_WithNonAggregate_543038() throws E // foo({1,2,3,1,2,3}); // eliding all levels // foo({{1,2,3},{1,2,3}}); // ERROR eliding outer-most is not allowed // } + @Test public void testBraceElisionForAggregateInit3_543038() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("foo({{{1,2,3},{1,2,3}}});", 3); @@ -13295,6 +13980,7 @@ public void testBraceElisionForAggregateInit3_543038() throws Exception { // foo({type{1},type{2}}); // foo({type{1}}); // ERROR: type is not default constructible // } + @Test public void testBraceElisionForAggregateInit4_nonDefaultConstructible_543038() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("foo({type{1},type{2}});", 3); @@ -13312,6 +13998,7 @@ public void testBraceElisionForAggregateInit4_nonDefaultConstructible_543038() t // foo({{1,2,3,{1,2,3}}}); // ok: data[1] is initialized without elision, data[0] with elision // foo({{1,2,{1,2,3}}}); // ERROR: trying to initialize data[0][2] with {1,2,3} // } + @Test public void testBraceElisionForAggregateInit5_partlyEliding_543038() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("foo({{{1,2,3},1,2,3}});", 3); @@ -13335,6 +14022,7 @@ public void testBraceElisionForAggregateInit5_partlyEliding_543038() throws Exce // int main() { // foo({1}); // } + @Test public void testBraceElisionForAggregateInit6_typedef_543038() throws Exception { parseAndCheckBindings(); } @@ -13348,6 +14036,7 @@ public void testBraceElisionForAggregateInit6_typedef_543038() throws Exception // auto s1 = S1 { }; // return S2 { s1 }; // } + @Test public void testBraceElisionForAggregateInit7_545957() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13356,6 +14045,7 @@ public void testBraceElisionForAggregateInit7_545957() throws Exception { // int a; // }; // type b{sizeof(type)}; + @Test public void testAggregateInitNoNarrowingConversionInConstContext_545756() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13368,6 +14058,7 @@ public void testAggregateInitNoNarrowingConversionInConstContext_545756() throws // struct B { // A a{sizeof(T)}; // }; + @Test public void testAggregateInitNoNarrowingConversionInDependentConstContext_545756() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13377,6 +14068,7 @@ public void testAggregateInitNoNarrowingConversionInDependentConstContext_545756 // }; // const unsigned long v = 1; // type b{v}; + @Test public void testAggregateInitNoNarrowingConversionInConstContext2_545756() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13386,6 +14078,7 @@ public void testAggregateInitNoNarrowingConversionInConstContext2_545756() throw // }; // unsigned long v = 1; // type b{v}; + @Test public void testAggregateInitNarrowingConversion_545756() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("b{v};", 1, IProblemBinding.class); @@ -13397,6 +14090,7 @@ public void testAggregateInitNarrowingConversion_545756() throws Exception { // }; // // type foo{"s"}; + @Test public void testCharArrayInitFromStringLiteral_545756() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13406,6 +14100,7 @@ public void testCharArrayInitFromStringLiteral_545756() throws Exception { // }; // // type foo{"big"}; + @Test public void testCharArrayInitFromTooLargeStringLiteral_545756() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("foo", 3, IProblemBinding.class); @@ -13416,6 +14111,7 @@ public void testCharArrayInitFromTooLargeStringLiteral_545756() throws Exception // }; // // type foo{L"s"}; + @Test public void testCharArrayInitFromWrongTypeStringLiteral_545756() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("foo", 3, IProblemBinding.class); @@ -13426,6 +14122,7 @@ public void testCharArrayInitFromWrongTypeStringLiteral_545756() throws Exceptio // }; // // type foo{"s"}; + @Test public void testUnknownSizeCharArrayInitFromStringLiteral_545756() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertImplicitName("foo", 3, IProblemBinding.class); @@ -13443,6 +14140,7 @@ public void testUnknownSizeCharArrayInitFromStringLiteral_545756() throws Except // Time time = t.get(); // } // }; + @Test public void testCopyInitializationFromDependentType_546843() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13460,6 +14158,7 @@ public void testCopyInitializationFromDependentType_546843() throws Exception { // Time time{t.get()}; // } // }; + @Test public void testListInitializationFromDependentType_546843() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13483,6 +14182,7 @@ public void testListInitializationFromDependentType_546843() throws Exception { // constexpr bool fptr_is_not_noexcept = noexcept(fptr()); // constexpr bool fptr_noexcept_is_noexcept = noexcept(fptr_noexcept()); // constexpr bool throw_is_not_noexcept = noexcept(throw fun_noexcept()); + @Test public void testNoexceptOperatorFunctions_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13507,6 +14207,7 @@ public void testNoexceptOperatorFunctions_545021() throws Exception { // constexpr bool not_noexcept_conditional = noexcept(noexcept_condition() ? fun() : fun_noexcept()); // constexpr bool is_noexcept_conditional = noexcept(noexcept_condition() ? fun_noexcept() : fun_noexcept()); // constexpr bool condition_not_noexcept = noexcept(condition() ? fun_noexcept() : fun_noexcept()); + @Test public void testNoexceptOperatorOperators_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13524,6 +14225,7 @@ public void testNoexceptOperatorOperators_545021() throws Exception { // // constexpr bool aggregate_init_is_noexcept = noexcept(aggregate{1}); // constexpr bool aggregate_access_is_noexcept = noexcept(agg.a); + @Test public void testNoexceptOperatorAggregate_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13539,6 +14241,7 @@ public void testNoexceptOperatorAggregate_545021() throws Exception { // constexpr bool ctor_is_noexcept = noexcept(myclass{}); // constexpr bool ctor_is_not_noexcept = noexcept(myclass{1}); // constexpr bool constexpr_ctor_is_noexcept = noexcept(myclass{1, 1}); + @Test public void testNoexceptOperatorConstructors_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13567,6 +14270,7 @@ public void testNoexceptOperatorConstructors_545021() throws Exception { // constexpr bool noexcept_conversion = noexcept(static_cast(t)); // constexpr bool not_noexcept_conversion = noexcept(static_cast(t)); // constexpr bool conversion_from_constructor = noexcept(static_cast(type{})); + @Test public void testNoexceptOperatorType_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13590,6 +14294,7 @@ public void testNoexceptOperatorType_545021() throws Exception { // // constexpr bool funt_is_not_noexcept = noexcept(funt(1)); // constexpr bool funt_noexcept_is_noexcept = noexcept(funt_noexcept(1)); + @Test public void testNoexceptOperatorFunctionTemplates_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13611,6 +14316,7 @@ public void testNoexceptOperatorFunctionTemplates_545021() throws Exception { // constexpr bool unaryop_is_not_noexcept = noexcept(!t1); // constexpr bool noexcept_binaryop_is_noexcept = noexcept(t2 = 1); // constexpr bool noexcept_unaryop_is_noexcept = noexcept(!t2); + @Test public void testNoexceptOperatorOverloadedOperators_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13624,6 +14330,7 @@ public void testNoexceptOperatorOverloadedOperators_545021() throws Exception { // void fun_taking_funptr(void(*ptr)()) noexcept; // // constexpr bool is_noexcept = noexcept(fun_taking_funptr(fun)); + @Test public void testNoexceptOperatorNoncalledFunctionPtr_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13632,6 +14339,7 @@ public void testNoexceptOperatorNoncalledFunctionPtr_545021() throws Exception { // void fun() throw(); // constexpr bool is_noexcept = noexcept(fun()); + @Test public void testNoexceptOperatorEmptyThrow_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13643,6 +14351,7 @@ public void testNoexceptOperatorEmptyThrow_545021() throws Exception { // auto closure = [](int i) {return i;}; // constexpr bool is_not_noexcept = noexcept(closure()); // constexpr bool conversion_is_noexcept = noexcept(static_cast(closure)); + @Test public void testNoexceptOperatorLambda_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13656,6 +14365,7 @@ public void testNoexceptOperatorLambda_545021() throws Exception { // // constexpr bool is_noexcept = noexcept(foo()); // constexpr bool is_not_noexcept = noexcept(foo()); + @Test public void testNoexceptOperatorDependentNoexcept_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13666,6 +14376,7 @@ public void testNoexceptOperatorDependentNoexcept_545021() throws Exception { // struct S { int mem; }; // S foo(); // could throw // constexpr bool is_not_noexcept = noexcept(foo().mem); // should be false + @Test public void testNoexceptOperatorOwnerEval_545021() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -13676,6 +14387,7 @@ public void testNoexceptOperatorOwnerEval_545021() throws Exception { // B a; // }; // B t{1}; + @Test public void testSelfAggregation_546805() throws Exception { // Note that ideally we would report an error already on the declaration of B as // the class is aggregating itself. Today, we only report an error because of a @@ -13692,6 +14404,7 @@ public void testSelfAggregation_546805() throws Exception { // A a; // }; // B t{1}; + @Test public void testIndirectSelfAggregation_546805() throws Exception { // See comment in previous test BindingAssertionHelper bh = getAssertionHelper(); @@ -13708,6 +14421,7 @@ public void testIndirectSelfAggregation_546805() throws Exception { // }; // // auto a = A{1, 2}; + @Test public void testClassFromInitList_549036() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -13715,6 +14429,7 @@ public void testClassFromInitList_549036() throws Exception { // int a = 42, b = 42; // float c = 3.14, d = 3.14; // char e[] = "waldo", f[] = "waldo"; + @Test public void testLiteralExpressionEquivalence_551689() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPASTExpression a = helper.assertNode("a = 42", "42"); @@ -13734,6 +14449,7 @@ public void testLiteralExpressionEquivalence_551689() throws Exception { // }; // struct [[nodiscard]] S : public Base { // }; + @Test public void testNoDiscardClass_Bug534420() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -13765,6 +14481,7 @@ public void testNoDiscardClass_Bug534420() throws Exception { //Foo var1; //Foo var2; //Foo var3; + @Test public void testNoDiscardTemplateSpecialization_Bug534420() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -13810,6 +14527,7 @@ public void testNoDiscardTemplateSpecialization_Bug534420() throws Exception { //Foo var1; //Foo var2; //Foo var3; + @Test public void testFinalTemplateSpecialization_Bug561631() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code); @@ -13849,6 +14567,7 @@ public void testFinalTemplateSpecialization_Bug561631() throws Exception { // enum fruit { apple, banana }; // enum hue col; // enum fruit f; + @Test public void testEnumerations_Bug534420() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -13869,6 +14588,7 @@ public void testEnumerations_Bug534420() throws Exception { // // template <> // void waldo(const IntPtr&) {} + @Test public void testExplicitSpecPointerType_562697() throws Exception { parseAndCheckBindings(); } @@ -13939,6 +14659,7 @@ public void testExplicitSpecPointerType_562697() throws Exception { // Test::Value>::false_val; // Test::Value>::true_val; // } + @Test public void testIsSame() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -13970,6 +14691,7 @@ public void testIsSame() throws Exception { // function(true ? 0 : 0); // 12 // functionPtr(true ? 0 : 0); // 13 // } + @Test public void testNullPointerConstantConversion_573764() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector collector = new NameCollector(); @@ -14020,6 +14742,7 @@ public void testNullPointerConstantConversion_573764() throws Exception { // // constexpr auto test_32 = calculate(1, 2); // constexpr auto test_64 = calculate(1, 2); + @Test public void testArithmeticConversionIssue_265() throws Exception { // Depending on size of integer types above it may happen that the rank of unsigned type operand // is less than rank of signed type operand, and both types are of same size. @@ -14034,6 +14757,7 @@ public void testArithmeticConversionIssue_265() throws Exception { } // constexpr auto shiftdouble = (1. << 1); + @Test public void testArithmeticEvaluationWithDoubleShiftOp() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable shiftdouble = helper.assertNonProblem("shiftdouble = ", 11); @@ -14042,6 +14766,7 @@ public void testArithmeticEvaluationWithDoubleShiftOp() throws Exception { } // constexpr auto shiftdouble = (1. <<= 1); + @Test public void testArithmeticEvaluationWithDoubleShiftAssignOp() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable shiftdouble = helper.assertNonProblem("shiftdouble = ", 11); @@ -14053,12 +14778,14 @@ public void testArithmeticEvaluationWithDoubleShiftAssignOp() throws Exception { // constexpr double zero = 0.; // constexpr double x = 1., y = 1.; // constexpr int shiftpack = ((x > zero) << Horizontal) | ((y > zero) << Vertical); + @Test public void testArithmeticEvaluationOfRelationalOps() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("shiftpack", 3); } // constexpr auto true_value = __builtin_is_constant_evaluated(); + @Test public void testBuiltinIsConstantEvaluated() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("true_value", 1); @@ -14078,6 +14805,7 @@ public void testBuiltinIsConstantEvaluated() throws Exception { // decl_function, // reference site marker // decl_simple, // reference site marker // }; + @Test public void testSimpleDeclarationOfFunction() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -14181,6 +14909,7 @@ public void testSimpleDeclarationOfFunction() throws Exception { // /* 65 */ true == __is_trivially_assignable(E&, E&), // }; // + @Test public void testIsAssignable() throws Exception { //parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU /* use GNU extensions */); BindingAssertionHelper helper = getAssertionHelper(CPP, ScannerKind.GNU /* use GNU extensions */); @@ -14197,6 +14926,6 @@ public void testIsAssignable() throws Exception { } } - assertEquals("Failed evaluations", 0, failures); + assertEquals((long) 0, (long) failures, "Failed evaluations"); } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CSpecTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CSpecTest.java index e38f7146bd1..c622b86f85a 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CSpecTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CSpecTest.java @@ -16,23 +16,18 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression; import org.eclipse.cdt.core.parser.ParserLanguage; +import org.junit.jupiter.api.Test; /** * @author dsteffle */ public class AST2CSpecTest extends AST2SpecTestBase { - public AST2CSpecTest() { - } - - public AST2CSpecTest(String name) { - super(name); - } - // /* Start Example(C 4-6) */ // #ifdef _ _STDC_IEC_559_ _ // FE_UPWARD defined // fesetround(FE_UPWARD); // #endif + @Test public void test4s6() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -40,6 +35,7 @@ public void test4s6() throws Exception { // /* Start Example(C 5.1.1.3-2) */ // char i; // int i; + @Test public void test5_1_1_3s2() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -49,6 +45,7 @@ public void test5_1_1_3s2() throws Exception { // char c1, c2; // c1 = c1 + c2; // } + @Test public void test5_1_2_3s10() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -59,6 +56,7 @@ public void test5_1_2_3s10() throws Exception { // double d; // f1 = f2 * d; // } + @Test public void test5_1_2_3s11() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -70,6 +68,7 @@ public void test5_1_2_3s11() throws Exception { // d1 = f = 1; // d2 = (float) 1; // } + @Test public void test5_1_2_3s12() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -82,6 +81,7 @@ public void test5_1_2_3s12() throws Exception { // z = x + x * y; // not equivalent toz = x * (1.0 + y); // y = x / 5.0; // not equivalent toy = x * 0.2; // } + @Test public void test5_1_2_3s13() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -95,6 +95,7 @@ public void test5_1_2_3s13() throws Exception { // a = ((a + 32765) + b); // a = (a + (b + 32765)); // } + @Test public void test5_1_2_3s14() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -107,12 +108,14 @@ public void test5_1_2_3s14() throws Exception { // sum = sum * 10 - '0' + (*p++ = getchar()); // sum = (((sum * 10) - '0') + ((*(p++)) = (getchar()))); // } + @Test public void test5_1_2_3s15() throws Exception { parseCandCPP(getAboveComment(), false, 0); } // /* Start Example(C 6.2.5-28) */ // struct tag (* a[5])(float); + @Test public void test6_2_5s28() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -121,6 +124,7 @@ public void test6_2_5s28() throws Exception { // int f(int (*)(), double (*)[3]); // int f(int (*)(char *), double (*)[]); // int f(int (*)(char *), double (*)[3]); + @Test public void test6_2_7s5() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -129,6 +133,7 @@ public void test6_2_7s5() throws Exception { // char x='\023'; // char y='\0'; // char z='\x13'; + @Test public void test6_4_4_4s12() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -142,6 +147,7 @@ public void test6_4_4_4s12() throws Exception { // int foo() { // int x=(*pf[f1()]) (f2(), f3() + f4()); // } + @Test public void test6_5_2_2s12() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -159,6 +165,7 @@ public void test6_5_2_2s12() throws Exception { // vs.i; // volatile int // vs.ci; // volatile const int // } + @Test public void test6_5_2_3s7() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -185,6 +192,7 @@ public void test6_5_2_3s7() throws Exception { // if (sin(u.nf.doublenode) == 0.0) // return 0; // } + @Test public void test6_5_2_3s8a() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -206,12 +214,14 @@ public void test6_5_2_3s8a() throws Exception { // } u; // return f(&u.s1, &u.s2); // } + @Test public void test6_5_2_3s8b() throws Exception { parseCandCPP(getAboveComment(), false, 0); } // /* Start Example(C 6.5.2.5-9) */ // int *p = (int []){2, 4}; + @Test public void test6_5_2_5s9() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -222,6 +232,7 @@ public void test6_5_2_5s9() throws Exception { // int *p; // p = (int [2]){*p}; // } + @Test public void test6_5_2_5s10() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -233,6 +244,7 @@ public void test6_5_2_5s10() throws Exception { // drawline(&(struct point){.x=1, .y=1}, // &(struct point){.x=3, .y=4}); // } + @Test public void test6_5_2_5s11() throws Exception { parse(getAboveComment(), ParserLanguage.C, false, 0); } @@ -241,6 +253,7 @@ public void test6_5_2_5s11() throws Exception { // int f() { // (const float []){1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6}; // } + @Test public void test6_5_2_5s12() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -251,6 +264,7 @@ public void test6_5_2_5s12() throws Exception { // (char []){"/tmp/fileXXXXXX"}; // (const char []){"/tmp/fileXXXXXX"}; // } + @Test public void test6_5_2_5s13() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -259,6 +273,7 @@ public void test6_5_2_5s13() throws Exception { // int f() { // (const char []){"abc"} == "abc"; // } + @Test public void test6_5_2_5s14() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -269,6 +284,7 @@ public void test6_5_2_5s14() throws Exception { // struct int_list endless_zeros = {0, &endless_zeros}; // eval(endless_zeros); // } + @Test public void test6_5_2_5s15() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -284,6 +300,7 @@ public void test6_5_2_5s15() throws Exception { // if (j < 2) goto again; // return p == q && q->i == 1; // } + @Test public void test6_5_2_5s16() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -291,6 +308,7 @@ public void test6_5_2_5s16() throws Exception { // /* Start Example(C 6.5.3.4-5) */ // extern void *alloc(size_t); // double *dp = alloc(sizeof *dp); + @Test public void test6_5_3_4s5() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -300,6 +318,7 @@ public void test6_5_3_4s5() throws Exception { // int array[5]; // int x = sizeof array / sizeof array[0]; // } + @Test public void test6_5_3_4s6() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -313,6 +332,7 @@ public void test6_5_3_4s6() throws Exception { // (*p)[2] = 99; // a[1][2] == 99 // n = p - a; // n == 1 // } + @Test public void test6_5_6s10() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -333,6 +353,7 @@ public void test6_5_6s10() throws Exception { // cond ? ip : c_ip; // cond ? vp : ip; // } + @Test public void test6_5_15s8() throws Exception { BindingAssertionHelper helper = new AST2AssertionHelper(getAboveComment(), ParserLanguage.C); IASTExpression c1 = helper.assertNode("cond ? c_vp : c_ip"); @@ -356,6 +377,7 @@ public void test6_5_15s8() throws Exception { // long l; // l = (c = i); // } + @Test public void test6_5_16_1s5() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -369,6 +391,7 @@ public void test6_5_16_1s5() throws Exception { // *cpp = &c; // valid // *p = 0; // valid // } + @Test public void test6_5_16_1s6() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -383,6 +406,7 @@ public void test6_5_16_1s6() throws Exception { // offsetof(struct s, d); // offsetof(struct ss, d); // } + @Test public void test6_7_2_1s17() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -394,6 +418,7 @@ public void test6_7_2_1s17() throws Exception { // s1 = malloc(sizeof (struct s) + 64); // s2 = malloc(sizeof (struct s) + 46); // } + @Test public void test6_7_2_1s18a() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -401,6 +426,7 @@ public void test6_7_2_1s18a() throws Exception { // /* Start Example(C 6.7.2.1-18b) */ // struct { int n; double d[8]; } *s1; // struct { int n; double d[5]; } *s2; + @Test public void test6_7_2_1s18b() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -414,6 +440,7 @@ public void test6_7_2_1s18b() throws Exception { // if (*cp != burgundy) // return 0; // } + @Test public void test6_7_2_2s5() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -424,6 +451,7 @@ public void test6_7_2_2s5() throws Exception { // struct tnode *left, *right; // }; // struct tnode s, *sp; + @Test public void test6_7_2_3s9() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -435,6 +463,7 @@ public void test6_7_2_3s9() throws Exception { // TNODE *left, *right; // }; // TNODE s, *sp; + @Test public void test6_7_2_3s10() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -443,12 +472,14 @@ public void test6_7_2_3s10() throws Exception { // struct s2; // struct s1 { struct s2 *s2p; }; // D1 // struct s2 { struct s1 *s1p; }; // D2 + @Test public void test6_7_2_3s11() throws Exception { parseCandCPP(getAboveComment(), true, 0); } // /* Start Example(C 6.7.3-10) */ // extern const volatile int real_time_clock; + @Test public void test6_7_3s10() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -468,6 +499,7 @@ public void test6_7_3s10() throws Exception { // pci = &cs.mem; // valid // pi = a[0]; // invalid: a[0] has type ''const int *'' // } + @Test public void test6_7_3s11() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -476,6 +508,7 @@ public void test6_7_3s11() throws Exception { // int * restrict a; // int * restrict b; // extern int c[]; + @Test public void test6_7_3_1s7() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -486,6 +519,7 @@ public void test6_7_3_1s7() throws Exception { // while (n-- > 0) // *p++ = *q++; // } + @Test public void test6_7_3_1s8() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -502,6 +536,7 @@ public void test6_7_3_1s8() throws Exception { // f(50, d + 50, d); // valid // f(50, d + 1, d); // undefined behavior // } + @Test public void test6_7_3_1s9() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -513,6 +548,7 @@ public void test6_7_3_1s9() throws Exception { // for (i = 0; i < n; i++) // p[i] = q[i] + r[i]; // } + @Test public void test6_7_3_1s10() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -530,6 +566,7 @@ public void test6_7_3_1s10() throws Exception { // p2 = q2; // undefined behavior // } // } + @Test public void test6_7_3_1s11() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -543,6 +580,7 @@ public void test6_7_3_1s11() throws Exception { // t.v = malloc(n * sizeof (float)); // return t; // } + @Test public void test6_7_3_1s12() throws Exception { parse(getAboveComment(), ParserLanguage.C, false, 0); } @@ -561,6 +599,7 @@ public void test6_7_3_1s12() throws Exception { // { // return is_fahr ? cels(temp) : fahr(temp); // } + @Test public void test6_7_4s7() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -570,12 +609,14 @@ public void test6_7_4s7() throws Exception { // int *const constant_ptr1; // typedef int *int_ptr; // const int_ptr constant_ptr2; + @Test public void test6_7_5_1s4() throws Exception { parseCandCPP(getAboveComment(), true, 0); } // /* Start Example(C 6.7.5.2-7) */ // float fa[11], *afp[17]; + @Test public void test6_7_5_2s7() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -583,6 +624,7 @@ public void test6_7_5_2s7() throws Exception { // /* Start Example(C 6.7.5.2-8) */ // extern int *x; // extern int y[]; + @Test public void test6_7_5_2s8() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -600,6 +642,7 @@ public void test6_7_5_2s8() throws Exception { // r = c; // compatible, but defined behavior only if // // n == 6 andm == n+1 // } + @Test public void test6_7_5_2s9() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -624,24 +667,28 @@ public void test6_7_5_2s9() throws Exception { // extern int (*r)[m]; // invalid: r has linkage and points to VLA // static int (*q)[m] = &B; // valid: q is a static block pointer to VLA // } + @Test public void test6_7_5_2s10() throws Exception { parseCandCPP(getAboveComment(), false, 0); } // /* Start Example(C 6.7.5.3-16) */ // int f(void), *fip(), (*pfi)(); + @Test public void test6_7_5_3s16() throws Exception { parseCandCPP(getAboveComment(), true, 0); } // /* Start Example(C 6.7.5.3-18) */ // int (*apfi[3])(int *x, int *y); + @Test public void test6_7_5_3s18() throws Exception { parseCandCPP(getAboveComment(), true, 0); } // /* Start Example(C 6.7.5.3-19) */ // int (*fpfi(int (*)(long), int))(int, ...); + @Test public void test6_7_5_3s19() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -663,6 +710,7 @@ public void test6_7_5_3s19() throws Exception { // // a is a pointer to a VLA with n*m+300 elements // a[i][j] += x; // } + @Test public void test6_7_5_3s20() throws Exception { String code = getAboveComment(); // no valid c++ code @@ -678,6 +726,7 @@ public void test6_7_5_3s20() throws Exception { // void f2(double a[restrict][5]); // void f3(double a[restrict 3][5]); // void f4(double a[restrict static 3][5]); + @Test public void test6_7_5_3s21() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -689,6 +738,7 @@ public void test6_7_5_3s21() throws Exception { // extern KLICKSP *metricp; // range x; // range z, *zp; + @Test public void test6_7_7s4() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -696,6 +746,7 @@ public void test6_7_7s4() throws Exception { // /* Start Example(C 6.7.7-5) */ // typedef struct s1 { int x; } t1, *tp1; // typedef struct s2 { int x; } t2, *tp2; + @Test public void test6_7_7s5() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -705,6 +756,7 @@ public void test6_7_7s5() throws Exception { // void (*signal(int, void (*)(int)))(int); // fv *signal(int, fv *); // pfv signal(int, pfv); + @Test public void test6_7_7s7() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -719,6 +771,7 @@ public void test6_7_7s7() throws Exception { // for (int i = 1; i < n; i++) // a[i-1] = b[i]; // } + @Test public void test6_7_7s8() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -726,12 +779,14 @@ public void test6_7_7s8() throws Exception { // /* Start Example(C 6.7.8-24) */ // int i = 3.5; // complex c = 5 + 3 * I; + @Test public void test6_7_8s24() throws Exception { parseCandCPP(getAboveComment(), false, 0); } // /* Start Example(C 6.7.8-25) */ // int x[] = { 1, 3, 5 }; + @Test public void test6_7_8s25() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -742,6 +797,7 @@ public void test6_7_8s25() throws Exception { // { 2, 4, 6 }, // { 3, 5, 7 }, // }; + @Test public void test6_7_8s26a() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -750,6 +806,7 @@ public void test6_7_8s26a() throws Exception { // int y[4][3] = { // 1, 3, 5, 2, 4, 6, 3, 5, 7 // }; + @Test public void test6_7_8s26b() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -758,12 +815,14 @@ public void test6_7_8s26b() throws Exception { // int z[4][3] = { // { 1 }, { 2 }, { 3 }, { 4 } // }; + @Test public void test6_7_8s27() throws Exception { parseCandCPP(getAboveComment(), true, 0); } // /* Start Example(C 6.7.8-28) */ // struct { int a[3], b; } w[] = { { 1 }, 2 }; + @Test public void test6_7_8s28() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -791,6 +850,7 @@ public void test6_7_8s28() throws Exception { // { 6 }, // } // }; + @Test public void test6_7_8s29() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -799,6 +859,7 @@ public void test6_7_8s29() throws Exception { // typedef int A[]; // OK - declared with block scope // A a1 = { 1, 2 }, b1 = { 3, 4, 5 }; // int a2[] = { 1, 2 }, b2[] = { 3, 4, 5 }; + @Test public void test6_7_8s31() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -810,6 +871,7 @@ public void test6_7_8s31() throws Exception { // t2[] = { 'a', 'b', 'c' }; // char *p = "abc"; // } + @Test public void test6_7_8s32() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -820,12 +882,14 @@ public void test6_7_8s32() throws Exception { // [member_two] = "member two", // [member_one] = "member one", // }; + @Test public void test6_7_8s33() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } // /* Start Example(C 6.7.8-34) */ // div_t answer = { .quot = 2, .rem = -1 }; + @Test public void test6_7_8s34() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 1); // div_t (correctly) cannot be resolved } @@ -833,6 +897,7 @@ public void test6_7_8s34() throws Exception { // /* Start Example(C 6.7.8-35) */ // struct { int a[3], b; } w[] = // { [0].a = {1}, [1].a[0] = 2 }; + @Test public void test6_7_8s35() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -842,12 +907,14 @@ public void test6_7_8s35() throws Exception { // int a[MAX] = { // 1, 3, 5, 7, 9, [MAX-5] = 8, 6, 4, 2, 0 // }; + @Test public void test6_7_8s36() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } // /* Start Example(C 6.7.8-38) */ // union { int any_member; } u = { .any_member = 42 }; + @Test public void test6_7_8s38() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -857,6 +924,7 @@ public void test6_7_8s38() throws Exception { // int f() { // (void)p(0); // } + @Test public void test6_8_3s4() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -867,6 +935,7 @@ public void test6_8_3s4() throws Exception { // while (*s++ != '\0') // ; // } + @Test public void test6_8_3s5() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -883,6 +952,7 @@ public void test6_8_3s5() throws Exception { // end_loop1: ; // } // } + @Test public void test6_8_3s6() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -900,6 +970,7 @@ public void test6_8_3s6() throws Exception { // f(i+1); // } // } + @Test public void test6_8_4s7() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -918,6 +989,7 @@ public void test6_8_4s7() throws Exception { // // handle other operations // } // } + @Test public void test6_8_6_1s3() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -937,6 +1009,7 @@ public void test6_8_6_1s3() throws Exception { // } // goto lab4; // invalid: going INTO scope of VLA. // } + @Test public void test6_8_6_1s4() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -960,6 +1033,7 @@ public void test6_8_6_1s4() throws Exception { // int foo() { // g.u2.f3 = f(); // } + @Test public void test6_8_6_4s4() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } @@ -969,6 +1043,7 @@ public void test6_8_6_4s4() throws Exception { // { // return a > b ? a : b; // } + @Test public void test6_9_1s13() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -979,6 +1054,7 @@ public void test6_9_1s13() throws Exception { // (*funcp)(); // funcp(); // } + @Test public void test6_9_1s14() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -999,6 +1075,7 @@ public void test6_9_1s14() throws Exception { // extern int i3; // refers to pre vious, whose linkage is external // extern int i4; // refers to pre vious, whose linkage is external // extern int i5; // refers to pre vious, whose linkage is internal + @Test public void test6_9_2s4() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -1012,6 +1089,7 @@ public void test6_9_2s4() throws Exception { // if ('z' - 'a' == 25) // g(); // } + @Test public void test6_10_1s4() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -1023,6 +1101,7 @@ public void test6_10_1s4() throws Exception { // #define join(c, d) in_between(c hash_hash d) // char p[] = join(x, y); // equivalent to // char p[] = "x ## y"; + @Test public void test6_10_3_3s4() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -1030,12 +1109,14 @@ public void test6_10_3_3s4() throws Exception { // /* Start Example(C 6.10.3.5-3) */ // #define TABSIZE 100 // int table[TABSIZE]; + @Test public void test6_10_3_5s3() throws Exception { parseCandCPP(getAboveComment(), true, 0); } // /* Start Example(C 6.10.3.5-4) */ // #define max(a, b) ((a) > (b) ? (a) : (b)) + @Test public void test6_10_3_5s4() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -1059,6 +1140,7 @@ public void test6_10_3_5s4() throws Exception { // p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) }; // char c[2][6] = { str(hello), str() }; // } + @Test public void test6_10_3_5s5() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -1083,6 +1165,7 @@ public void test6_10_3_5s5() throws Exception { // char * c = glue(HIGH, LOW); // c = xglue(HIGH, LOW); // } + @Test public void test6_10_3_5s6() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -1091,6 +1174,7 @@ public void test6_10_3_5s6() throws Exception { // #define t(x,y,z) x ## y ## z // int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), // t(10,,), t(,11,), t(,,12), t(,,) }; + @Test public void test6_10_3_5s7() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -1103,6 +1187,7 @@ public void test6_10_3_5s7() throws Exception { // #define FUNC_LIKE2( a )( \ // a \ // ) + @Test public void test6_10_3_5s8() throws Exception { parseCandCPP(getAboveComment(), true, 0); } @@ -1118,6 +1203,7 @@ public void test6_10_3_5s8() throws Exception { // showlist(The first, second, and third items.); // report(x>y, "x is %d but y is %d", x, y); // } + @Test public void test6_10_3_5s9() throws Exception { parseCandCPP(getAboveComment(), false, 0); } @@ -1132,6 +1218,7 @@ public void test6_10_3_5s9() throws Exception { // }; // t f(t (t)); // long t; + @Test public void test6_7_7s6() throws Exception { parse(getAboveComment(), ParserLanguage.C, true, 0); } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java index fa820d64fb0..0c4010e69dd 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java @@ -15,6 +15,12 @@ *******************************************************************************/ package org.eclipse.cdt.core.parser.tests.ast2; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator; import org.eclipse.cdt.core.dom.ast.IASTArraySubscriptExpression; import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; @@ -58,19 +64,13 @@ import org.eclipse.cdt.internal.core.dom.parser.c.CScope; import org.eclipse.cdt.internal.core.dom.parser.c.CVisitor; import org.eclipse.cdt.internal.core.dom.parser.c.ICInternalBinding; +import org.junit.jupiter.api.Test; /** * @author dsteffle */ public class AST2KnRTests extends AST2TestBase { - - public AST2KnRTests() { - } - - public AST2KnRTests(String name) { - super(name); - } - + @Test public void testSimpleKRCTest1() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int f(char x);\n"); //$NON-NLS-1$ @@ -113,6 +113,7 @@ public void testSimpleKRCTest1() throws Exception { .getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$ } + @Test public void testSimpleKRCTest2() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int f();\n"); //$NON-NLS-1$ @@ -149,6 +150,7 @@ public void testSimpleKRCTest2() throws Exception { .getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$ } + @Test public void testSimpleKRCTest3() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int const *f();\n"); //$NON-NLS-1$ @@ -175,6 +177,7 @@ public void testSimpleKRCTest3() throws Exception { assertEquals(x3, x4); } + @Test public void testKRC_1() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int isroot (x, y) /* comment */ \n"); //$NON-NLS-1$ @@ -228,6 +231,7 @@ public void testKRC_1() throws Exception { .getBinding(CScope.NAMESPACE_TYPE_OTHER, "y".toCharArray())); //$NON-NLS-1$ } + @Test public void testKRCWithTypes() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("typedef char c;\n"); //$NON-NLS-1$ @@ -287,6 +291,7 @@ public void testKRCWithTypes() throws Exception { .getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$ } + @Test public void testKRCProblem1() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int f(x) char\n"); //$NON-NLS-1$ @@ -297,6 +302,7 @@ public void testKRCProblem1() throws Exception { assertTrue(CVisitor.getProblems(tu).length > 0); } + @Test public void testKRCProblem2() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int i=0;\n"); //$NON-NLS-1$ @@ -308,6 +314,7 @@ public void testKRCProblem2() throws Exception { assertTrue(CVisitor.getProblems(tu).length > 0); } + @Test public void testKRCProblem3() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int f(x) char y;\n"); //$NON-NLS-1$ @@ -344,6 +351,7 @@ public void testKRCProblem3() throws Exception { assertEquals(decls.length, 0); } + @Test public void testKRCProblem4() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int f(x,y,z) char x,y,z; int a;\n"); //$NON-NLS-1$ @@ -405,6 +413,7 @@ public void testKRCProblem4() throws Exception { assertEquals(decls[0], x2); } + @Test public void testKRCProblem5() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int f(x) char x,a;\n"); //$NON-NLS-1$ @@ -441,6 +450,7 @@ public void testKRCProblem5() throws Exception { assertEquals(decls.length, 0); } + @Test public void testKRC_monop_cards1() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("#ifdef __STDC__\n"); //$NON-NLS-1$ @@ -493,8 +503,7 @@ public void testKRC_monop_cards1() throws Exception { assertTrue(A.getDeclSpecifier() instanceof IASTElaboratedTypeSpecifier); IASTName A_struct_name_2 = ((IASTElaboratedTypeSpecifier) A.getDeclSpecifier()).getName(); assertEquals(A_struct_name_2.toString(), "A_struct"); //$NON-NLS-1$ - assertEquals(((IASTElaboratedTypeSpecifier) A.getDeclSpecifier()).getStorageClass(), - IASTDeclSpecifier.sc_typedef); + assertEquals(A.getDeclSpecifier().getStorageClass(), IASTDeclSpecifier.sc_typedef); ICompositeType A_struct_type2 = (ICompositeType) A_struct_name_2.resolveBinding(); assertEquals(A_struct_type2, A_struct_type1); @@ -577,6 +586,7 @@ public void testKRC_monop_cards1() throws Exception { .getBinding(CScope.NAMESPACE_TYPE_OTHER, "x".toCharArray())); //$NON-NLS-1$ } + @Test public void testKRC_monop_cards2() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int\n"); //$NON-NLS-1$ @@ -603,7 +613,7 @@ public void testKRC_monop_cards2() throws Exception { IASTSimpleDeclaration parm_decl = (IASTSimpleDeclaration) ((ICASTKnRFunctionDeclarator) getinp.getDeclarator()) .getParameterDeclarations()[0]; - assertTrue(((IASTSimpleDeclSpecifier) parm_decl.getDeclSpecifier()).isConst()); + assertTrue(parm_decl.getDeclSpecifier().isConst()); assertEquals(((IASTSimpleDeclSpecifier) parm_decl.getDeclSpecifier()).getType(), IASTSimpleDeclSpecifier.t_char); IASTDeclarator prompt = parm_decl.getDeclarators()[0]; @@ -625,6 +635,7 @@ public void testKRC_monop_cards2() throws Exception { assertEquals(decls[0], prompt2); } + @Test public void testKRC_getParametersOrder() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("int f(a, b) int b,a;{}\n"); //$NON-NLS-1$ @@ -639,6 +650,7 @@ public void testKRC_getParametersOrder() throws Exception { assertEquals(((CParameter) f_parms[1]).getName(), "b"); //$NON-NLS-1$ } + @Test public void testKRC_Ethereal_1() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("struct symbol {\n"); //$NON-NLS-1$ @@ -695,6 +707,7 @@ public void testKRC_Ethereal_1() throws Exception { assertEquals(lemp_name3.resolveBinding(), lemp_name4.resolveBinding()); } + @Test public void testBug97447() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("void f(a) int a; {} \n"); //$NON-NLS-1$ @@ -709,6 +722,7 @@ public void testBug97447() throws Exception { IParameter a = (IParameter) col.getName(4).resolveBinding(); } + @Test public void testBug100104() throws Exception { StringBuilder buffer = new StringBuilder(); buffer.append("typedef int ush;\n"); //$NON-NLS-1$ @@ -747,6 +761,7 @@ public void testBug100104() throws Exception { // { // return 0; // } + @Test public void testBug203050() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), ParserLanguage.C, ScannerKind.GNU, true); assertTrue(tu.getDeclarations()[0] instanceof IASTSimpleDeclaration); @@ -773,6 +788,7 @@ public void testBug203050() throws Exception { // char (*in_char)(void); // int conv_base; // {} + @Test public void testFunctionPtrParameter_378614() throws Exception { String code = getAboveComment(); parseAndCheckBindings(code, ParserLanguage.C, ScannerKind.GNU); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java index 2115fe0e6cd..88aa68eab0e 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java @@ -14,6 +14,8 @@ *******************************************************************************/ package org.eclipse.cdt.core.parser.tests.ast2; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.util.ArrayList; import java.util.List; @@ -45,14 +47,6 @@ * @author dsteffle */ public abstract class AST2SpecTestBase extends AST2TestBase { - public AST2SpecTestBase() { - super(); - } - - public AST2SpecTestBase(String name) { - super(name); - } - /** * checkSemantics is used to specify whether the example should have semantics checked * since several spec examples have syntactically correct code ONLY this flag was added diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateLValueRValueTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateLValueRValueTests.java index 02764bb0445..b1e697f4109 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateLValueRValueTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateLValueRValueTests.java @@ -1,6 +1,7 @@ package org.eclipse.cdt.core.parser.tests.ast2; import static org.eclipse.cdt.core.parser.ParserLanguage.CPP; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; @@ -9,16 +10,10 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionInstance; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunctionTemplate; import org.eclipse.cdt.internal.core.parser.ParserException; +import org.junit.jupiter.api.Test; public class AST2TemplateLValueRValueTests extends AST2CPPTestBase { - public AST2TemplateLValueRValueTests() { - } - - public AST2TemplateLValueRValueTests(String name) { - super(name); - } - // class clazz { // }; // @@ -46,6 +41,7 @@ public AST2TemplateLValueRValueTests(String name) { // { // demo(getClazz()); // } + @Test public void test_lvalue_rvalue_caller_templateLvalue_templateRvalue_function() throws Exception { parseAndCheckBindings(); BindingAssertionHelper helper = getAssertionHelper(); @@ -86,6 +82,7 @@ public void test_lvalue_rvalue_caller_templateLvalue_templateRvalue_function() t // { // demo(getClazz()); // } + @Test public void test_lvalueTypedef_rvalueTypedef_caller_templateLvalue_templateRvalue_function() throws Exception { parseAndCheckBindings(); @@ -128,6 +125,7 @@ public void test_lvalueTypedef_rvalueTypedef_caller_templateLvalue_templateRvalu // { // demo(getClazz()); // } + @Test public void test_lvalueTypedefRef_rvalueTypedefRef_caller_templateLvalue_templateRvalue_function() throws Exception { parseAndCheckBindings(); @@ -170,6 +168,7 @@ public void test_lvalueTypedefRef_rvalueTypedefRef_caller_templateLvalue_templat // { // demo(getClazz()); // } + @Test public void test_lvalueTypedefRef_rvalueTypedefRef_caller_templateTpedefLvalue_templateRvalue_function() throws Exception { parseAndCheckBindings(); @@ -204,6 +203,7 @@ public void test_lvalueTypedefRef_rvalueTypedefRef_caller_templateTpedefLvalue_t // int c; // demo(c); // } + @Test public void test_lvalue_rvalue_caller_templateLvalue_templateRvalue_lvalue_function() throws Exception { parseAndCheckBindings(); @@ -225,6 +225,7 @@ public void test_lvalue_rvalue_caller_templateLvalue_templateRvalue_lvalue_funct // clazz c; // demo(c); // } + @Test public void test_lvalue_caller_rvalue_function() throws Exception { parseAndCheckBindingsForOneProblem(); } @@ -241,6 +242,7 @@ public void test_lvalue_caller_rvalue_function() throws Exception { // clazz c; // demo(c); // } + @Test public void test_lvalue_caller_lvalue_function() throws Exception { parseAndCheckBindings(); } @@ -267,6 +269,7 @@ public void test_lvalue_caller_lvalue_function() throws Exception { // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_lvalue_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -287,6 +290,7 @@ public void test_rvalue_caller_lvalue_rvalue_function() throws Exception { // clazz c; // demo(c); // } + @Test public void test_lvalue_caller_templateRvalue_lvalue_function() throws Exception { parseAndCheckBindings(); } @@ -312,6 +316,7 @@ public void test_lvalue_caller_templateRvalue_lvalue_function() throws Exception // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_templateRvalue_lvalue_function() throws Exception { parseAndCheckBindings(); } @@ -332,6 +337,7 @@ public void test_rvalue_caller_templateRvalue_lvalue_function() throws Exception // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_lvalue_function() throws Exception { parseAndCheckBindingsForOneProblem(); } @@ -352,6 +358,7 @@ public void test_rvalue_caller_lvalue_function() throws Exception { // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -372,6 +379,7 @@ public void test_rvalue_caller_rvalue_function() throws Exception { // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_templateLvalue_function() throws Exception { parseAndCheckBindingsForOneProblem(); } @@ -393,6 +401,7 @@ public void test_rvalue_caller_templateLvalue_function() throws Exception { // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_templateRvalue_function() throws Exception { parseAndCheckBindings(); } @@ -414,6 +423,7 @@ public void test_rvalue_caller_templateRvalue_function() throws Exception { // { // demo(getClazz()); // } + @Test public void test_templatedRvalue_caller__templateRvalue_lvalue_function() throws Exception { parseAndCheckBindings(); } @@ -433,6 +443,7 @@ public void test_templatedRvalue_caller__templateRvalue_lvalue_function() throws // clazz c; // demo(c); // } + @Test public void test_templatedLvalue_caller__templateRvalue_lvalue_function() throws Exception { parseAndCheckBindingsForProblem(); } @@ -452,6 +463,7 @@ public void test_templatedLvalue_caller__templateRvalue_lvalue_function() throws // clazz c; // demo(c); // } + @Test public void test_lvalue_caller_templateLvalue_lvalue_function() throws Exception { parseAndCheckBindings(); } @@ -476,6 +488,7 @@ public void test_lvalue_caller_templateLvalue_lvalue_function() throws Exception // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_templateLvalue_lvalue_function() throws Exception { parseAndCheckBindingsForOneProblem(); } @@ -500,6 +513,7 @@ public void test_rvalue_caller_templateLvalue_lvalue_function() throws Exception // { // demo(getClazz()); // } + @Test public void test_templatedRvalue_caller_templatedLValue_lvalAST2TemplateRValueRValueTestsue_function() throws Exception { parseAndCheckBindingsForProblem(); @@ -520,6 +534,7 @@ public void test_templatedRvalue_caller_templatedLValue_lvalAST2TemplateRValueRV // clazz c; // demo(c); // } + @Test public void test_templatedLvalue_caller_templatedLValue_lvalue_function() throws Exception { parseAndCheckBindings(); } @@ -539,6 +554,7 @@ public void test_templatedLvalue_caller_templatedLValue_lvalue_function() throws // clazz c; // demo(c); // } + @Test public void test_lvalue_caller_templatedRvalue_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -563,6 +579,7 @@ public void test_lvalue_caller_templatedRvalue_rvalue_function() throws Exceptio // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_templatedRvalue_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -587,6 +604,7 @@ public void test_rvalue_caller_templatedRvalue_rvalue_function() throws Exceptio // { // demo(getClazz()); // } + @Test public void test_templatedRvalue_caller_templatedRvalue_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -606,6 +624,7 @@ public void test_templatedRvalue_caller_templatedRvalue_rvalue_function() throws // clazz c; // demo(c); // } + @Test public void test_templatedLvalue_caller_templatedRvalue_rvalue_function() throws Exception { parseAndCheckBindingsForProblem(); } @@ -625,6 +644,7 @@ public void test_templatedLvalue_caller_templatedRvalue_rvalue_function() throws // clazz c; // demo(c); // } + @Test public void test_lvalue_caller_templatedLvalue_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -649,6 +669,7 @@ public void test_lvalue_caller_templatedLvalue_rvalue_function() throws Exceptio // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_templatedLvalue_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -673,6 +694,7 @@ public void test_rvalue_caller_templatedLvalue_rvalue_function() throws Exceptio // { // demo(getClazz()); // } + @Test public void test_templatedRvalue_caller_templatedLvalue_rvalue_function() throws Exception { parseAndCheckBindingsForProblem(); } @@ -692,6 +714,7 @@ public void test_templatedRvalue_caller_templatedLvalue_rvalue_function() throws // clazz c; // demo(c); // } + @Test public void test_templatedLvalue_caller_templatedLvalue_rvalue_function() throws Exception { parseAndCheckBindings(); } @@ -712,6 +735,7 @@ public void test_templatedLvalue_caller_templatedLvalue_rvalue_function() throws // clazz c; // demo(c); // } + @Test public void test_lvalue_caller_templatedLvalue_templatedRvalue_function() throws Exception { parseAndCheckBindings(); } @@ -737,6 +761,7 @@ public void test_lvalue_caller_templatedLvalue_templatedRvalue_function() throws // { // demo(getClazz()); // } + @Test public void test_rvalue_caller_templatedLvalue_templatedRvalue_function() throws Exception { parseAndCheckBindings(); } @@ -762,6 +787,7 @@ public void test_rvalue_caller_templatedLvalue_templatedRvalue_function() throws // { // demo(getClazz()); // } + @Test public void test_templatedRvalue_caller_templatedLvalue_templatedRvalue_function() throws Exception { parseAndCheckBindings(); } @@ -782,6 +808,7 @@ public void test_templatedRvalue_caller_templatedLvalue_templatedRvalue_function // clazz c; // demo(c); // } + @Test public void test_templatedLvalue_caller_templatedLvalue_templatedRvalue_function() throws Exception { parseAndCheckBindings(); } @@ -803,6 +830,7 @@ public void test_templatedLvalue_caller_templatedLvalue_templatedRvalue_function // { // demo(getClazz()); // } + @Test public void test_templatedRvalue_caller_templatedLvalue_function() throws Exception { parseAndCheckBindingsForProblem(); } @@ -824,6 +852,7 @@ public void test_templatedRvalue_caller_templatedLvalue_function() throws Except // { // demo(getClazz()); // } + @Test public void test_templatedRvalue_caller_templatedRvalue_function() throws Exception { parseAndCheckBindings(); } @@ -840,6 +869,7 @@ public void test_templatedRvalue_caller_templatedRvalue_function() throws Except // clazz c; // demo(c); // } + @Test public void test_templatedLvalue_caller_templatedLvalue_function() throws Exception { parseAndCheckBindings(); } @@ -856,6 +886,7 @@ public void test_templatedLvalue_caller_templatedLvalue_function() throws Except // clazz c; // demo(c); // } + @Test public void test_templatedLvalue_caller_templatedRvalue_function() throws Exception { parseAndCheckBindingsForProblem(); } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index bf88377f26b..7e1b7266307 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -27,6 +27,13 @@ import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getNestedType; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateType; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.eclipse.cdt.core.dom.IName; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; @@ -49,7 +56,6 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeId; import org.eclipse.cdt.core.dom.ast.IBasicType; import org.eclipse.cdt.core.dom.ast.IBinding; -import org.eclipse.cdt.core.dom.ast.ICompositeType; import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.dom.ast.IField; import org.eclipse.cdt.core.dom.ast.IFunction; @@ -110,28 +116,17 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknownScope; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPUnknownBinding; import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil; - -import junit.framework.TestSuite; +import org.junit.jupiter.api.Test; public class AST2TemplateTests extends AST2CPPTestBase { - public AST2TemplateTests() { - } - - public AST2TemplateTests(String name) { - super(name); - } - - public static TestSuite suite() { - return suite(AST2TemplateTests.class); - } - private NameCollector getNameCollector(IASTTranslationUnit ast) { NameCollector collector = new NameCollector(); ast.accept(collector); return collector; } + @Test public void testBasicClassTemplate() throws Exception { IASTTranslationUnit tu = parse("template class A{ T t; };", CPP); //$NON-NLS-1$ NameCollector col = new NameCollector(); @@ -164,6 +159,7 @@ public void testBasicClassTemplate() throws Exception { // A a; // a.t1; a.t2; // } + @Test public void testBasicTemplateInstance_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -188,7 +184,7 @@ public void testBasicTemplateInstance_a() throws Exception { assertSame(((ICPPTemplateInstance) A_int).getTemplateDefinition(), A); ICPPClassScope A_int_Scope = (ICPPClassScope) A_int.getCompositeScope(); - assertNotSame(A_int_Scope, ((ICompositeType) A).getCompositeScope()); + assertNotSame(A_int_Scope, A.getCompositeScope()); ICPPField t = (ICPPField) col.getName(11).resolveBinding(); assertTrue(t instanceof ICPPSpecialization); @@ -215,6 +211,7 @@ public void testBasicTemplateInstance_a() throws Exception { // A a; // a.f((int*)0); // } + @Test public void testBasicTemplateInstance_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -247,6 +244,7 @@ public void testBasicTemplateInstance_b() throws Exception { // void foo() { // f(0); // } + @Test public void testBasicTemplateFunction() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -276,6 +274,7 @@ public void testBasicTemplateFunction() throws Exception { // template < class T > class pair { // template < class U > pair(const pair &); // }; + @Test public void testStackOverflow_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -297,6 +296,7 @@ public void testStackOverflow_a() throws Exception { // template < class T > class A {}; // template < class T > class A< T* > {}; // template < class T > class A< T** > {}; + @Test public void testBasicClassPartialSpecialization() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -325,6 +325,7 @@ public void testBasicClassPartialSpecialization() throws Exception { // template < class T > class A { typedef int TYPE; }; // template < class T > typename A::TYPE foo(T); // template < class T > typename A::TYPE foo(T); + @Test public void testStackOverflow_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -360,6 +361,7 @@ public void testStackOverflow_b() throws Exception { // struct A : public _A_::member_t {}; // // struct B : public A{}; + @Test public void testStackOverflowInBaseComputation_418996() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPClassType B = helper.assertNonProblem("A", 4); @@ -371,6 +373,7 @@ public void testStackOverflowInBaseComputation_418996() throws Exception { // void f(); // }; // template < class T > void A::f() { } + @Test public void testTemplateMemberDef() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -389,6 +392,7 @@ public void testTemplateMemberDef() throws Exception { // const int *p; // f(p); //calls f(const T *) , 3 is more specialized than 1 or 2 // } + @Test public void test14_5_5_2s5_OrderingFunctionTemplates_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -413,6 +417,7 @@ public void test14_5_5_2s5_OrderingFunctionTemplates_a() throws Exception { // float x; // f(x); //ambiguous 1 or 2 // } + @Test public void test14_5_5_2s5_OrderingFunctionTemplates_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -431,6 +436,7 @@ public void test14_5_5_2s5_OrderingFunctionTemplates_b() throws Exception { // void main() { // f({1,2,3}); // } + @Test public void test_dr1591_DeduceArrayFromInitializerList_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -450,6 +456,7 @@ public void test_dr1591_DeduceArrayFromInitializerList_a() throws Exception { // void main() { // f({1,2,3}); // } + @Test public void test_dr1591_DeduceArrayFromInitializerList_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -469,6 +476,7 @@ public void test_dr1591_DeduceArrayFromInitializerList_b() throws Exception { // void main() { // f({1,2.0,3}); // } + @Test public void test_dr1591_DeduceArrayFromInitializerList_c() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -486,6 +494,7 @@ public void test_dr1591_DeduceArrayFromInitializerList_c() throws Exception { // template < class T, template < class X > class U, T *pT > class A { // }; + @Test public void testTemplateParameters() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -513,6 +522,7 @@ public void testTemplateParameters() throws Exception { // A * b; // b->a; // } + @Test public void testDeferredInstances() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -553,6 +563,7 @@ public void testDeferredInstances() throws Exception { // A a3; //uses #4, T is char // A a4; //uses #5, T is int, T2 is char, I is1 // A a5; //ambiguous, matches #3 & #5. + @Test public void test14_5_4_1s2_MatchingTemplateSpecializations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -596,6 +607,7 @@ public void test14_5_4_1s2_MatchingTemplateSpecializations() throws Exception { // template class A { }; // template class A ()> { }; // A a1; // uses specialisation + @Test public void testPrimitiveMatchingSpecializations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -616,6 +628,7 @@ public void testPrimitiveMatchingSpecializations() throws Exception { // template void f(T*); // template <> void f(int); //ok // template <> void f(int*); //ok + @Test public void test14_7_3_FunctionExplicitSpecialization() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -633,6 +646,7 @@ public void test14_7_3_FunctionExplicitSpecialization() throws Exception { // template void f(T*); // void g(int* p) { f(p); } + @Test public void test14_5_5_1_FunctionTemplates_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -647,6 +661,7 @@ public void test14_5_5_1_FunctionTemplates_a() throws Exception { // template void f(T); // void g(int* p) { f(p); } + @Test public void test14_5_5_1_FunctionTemplates_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -663,6 +678,7 @@ public void test14_5_5_1_FunctionTemplates_b() throws Exception { // void g(){ // int i = f(5); // Y is int // } + @Test public void test14_8_1s2_FunctionTemplates() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -679,6 +695,7 @@ public void test14_8_1s2_FunctionTemplates() throws Exception { // void g(){ // f("Annemarie"); // } + @Test public void test14_8_3s6_FunctionTemplates() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -699,6 +716,7 @@ public void test14_8_3s6_FunctionTemplates() throws Exception { // f(ip); //calls #2 // g(ip); //calls #4 // } + @Test public void test14_5_5_2s6_FunctionTemplates() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -726,6 +744,7 @@ public void test14_5_5_2s6_FunctionTemplates() throws Exception { // X* p; // meaning X // X* p2; // }; + @Test public void test14_6_1s1_LocalNames() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -747,6 +766,7 @@ public void test14_6_1s1_LocalNames() throws Exception { // f(&a); //call f(int*) // f(&b); //call f(char**) // } + @Test public void test14_8s2() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -778,6 +798,7 @@ public void test14_8s2() throws Exception { // template inline T g(T) { } // template<> inline void f<>(int) { } //OK: inline // template<> int g<>(int) { } // OK: not inline + @Test public void test14_7_3s14() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -792,8 +813,8 @@ public void test14_7_3s14() throws Exception { assertSame(f2.getSpecializedBinding(), f1); assertSame(g2.getSpecializedBinding(), g1); - assertFalse(((ICPPFunction) f1).isInline()); - assertTrue(((ICPPFunction) g1).isInline()); + assertFalse(f1.isInline()); + assertTrue(g1.isInline()); assertTrue(((ICPPFunction) f2).isInline()); assertFalse(((ICPPFunction) g2).isInline()); } @@ -807,6 +828,7 @@ public void test14_7_3s14() throws Exception { // X x; // x.a.a.a.a; // } + @Test public void test14_7_1s14_InfiniteInstantiation() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -839,6 +861,7 @@ public void test14_7_1s14_InfiniteInstantiation() throws Exception { // Y* p; // meaning Y // Y* q; // meaning Y // }; + @Test public void test14_6_1s2() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -863,6 +886,7 @@ public void test14_6_1s2() throws Exception { // void foo () { // f(g); // } + @Test public void testBug45129() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -886,6 +910,7 @@ public void testBug45129() throws Exception { // A a; // a.u; // } + @Test public void testBug76951() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -916,6 +941,7 @@ public void testBug76951() throws Exception { // A< int > a; // }; // void f(A p) { } + @Test public void testInstances() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -932,6 +958,7 @@ public void testInstances() throws Exception { // template void f(T); // template void f(T) {} + @Test public void testTemplateParameterDeclarations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -954,6 +981,7 @@ public void testTemplateParameterDeclarations() throws Exception { // a->f(a); // a->pA; // }; + @Test public void testDeferredInstantiation() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1000,6 +1028,7 @@ public void testDeferredInstantiation() throws Exception { // ac.f('c'); //template // ac.f<>(1); //template // } + @Test public void test14_5_2s2_MemberSpecializations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1044,6 +1073,7 @@ public void test14_5_2s2_MemberSpecializations() throws Exception { // template <> class A {}; // A ac; // A ai; + @Test public void testClassSpecializations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1076,6 +1106,7 @@ public void testClassSpecializations() throws Exception { // // explicit specialization syntax not used for a member of // // explicitly specialized class template specialization // void A::f(int) { } + @Test public void test14_7_3s5_SpecializationMemberDefinition() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1113,6 +1144,7 @@ public void test14_7_3s5_SpecializationMemberDefinition() throws Exception { // C c; // b.f(c); // } + @Test public void testNestedSpecializations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1155,6 +1187,7 @@ public void testNestedSpecializations() throws Exception { // template class A { }; // } // A a; + @Test public void test14_5_4s7_UsingClassTemplate() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1186,6 +1219,7 @@ public void test14_5_4s7_UsingClassTemplate() throws Exception { // C c; // c.y.x; c.z.x; // } + @Test public void testTemplateTemplateParameter() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1234,6 +1268,7 @@ public void testTemplateTemplateParameter() throws Exception { // A a; // a.t; // } + @Test public void testNestedTypeSpecializations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1268,6 +1303,7 @@ public void testNestedTypeSpecializations() throws Exception { // A a; // a.b.t; // } + @Test public void testNestedClassTypeSpecializations() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1307,6 +1343,7 @@ public void testNestedClassTypeSpecializations() throws Exception { // void f() { // A< C > a; a.s; // }; + @Test public void testTemplateParameterQualifiedType() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1359,6 +1396,7 @@ public void testTemplateParameterQualifiedType() throws Exception { // template void A::f(){ // U u; // } + @Test public void testTemplateScopes_a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1382,6 +1420,7 @@ public void testTemplateScopes_a() throws Exception { // template < class T > void f(T); // }; // template void A::f<>(U){} + @Test public void testTemplateScopes_b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1416,6 +1455,7 @@ public void testTemplateScopes_b() throws Exception { // // A ab; // A ac; + @Test public void testEnclosingScopes_a() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -1431,8 +1471,8 @@ public void testEnclosingScopes_a() throws Exception { assertInstance(b0.getScope(), ICPPTemplateScope.class); - IScope ts0 = ((ICPPClassType) b0.getSpecializedBinding()).getScope(); - IScope ts1 = ((ICPPClassType) b1.getSpecializedBinding()).getScope(); + IScope ts0 = b0.getSpecializedBinding().getScope(); + IScope ts1 = b1.getSpecializedBinding().getScope(); assertInstance(ts0, ICPPTemplateScope.class); @@ -1457,6 +1497,7 @@ public void testEnclosingScopes_a() throws Exception { // A::B acb; // A::B adb; // } + @Test public void testEnclosingScopes_b() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -1484,6 +1525,7 @@ public void testEnclosingScopes_b() throws Exception { // }; // // X::Y::Z xayz; + @Test public void testEnclosingScopes_c() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -1508,6 +1550,7 @@ public void testEnclosingScopes_c() throws Exception { // }; // // X::N n; + @Test public void testEnclosingScopes_d() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -1534,6 +1577,7 @@ public void testEnclosingScopes_d() throws Exception { // template<> template<> void A::g(int,char); // template<> template<> void A::g(int,char); // template<> void A::h(int) { } + @Test public void test14_7_3s16() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1596,6 +1640,7 @@ public void test14_7_3s16() throws Exception { // template void N::B::f(C) { // C b; // C is the template parameter, not N::C // } + @Test public void test14_6_1s6() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1629,6 +1674,7 @@ public void test14_6_1s6() throws Exception { // template class Array {}; // template void sort(Array &); // template void sort<>(Array &); + @Test public void testBug90689_ExplicitInstantiation() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1655,6 +1701,7 @@ public void testBug90689_ExplicitInstantiation() throws Exception { // template class Array; // template void sort(Array& v) { } // template void sort(Array&); // argument is deduced here + @Test public void test14_7_2s2_ExplicitInstantiation() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1678,6 +1725,7 @@ public void test14_7_2s2_ExplicitInstantiation() throws Exception { // A* p; // void f() { this; } // }; + @Test public void testBug74204() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1698,6 +1746,7 @@ public void testBug74204() throws Exception { // template void g(T t){ // f(t); // } + @Test public void testDeferredFunctionTemplates() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1717,6 +1766,7 @@ public void testDeferredFunctionTemplates() throws Exception { // init(a); // } // }; + @Test public void testRelaxationForTemplateInheritance() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1743,6 +1793,7 @@ public void testRelaxationForTemplateInheritance() throws Exception { // i->foo; i[0].foo; // } // } + @Test public void testBug91707() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1773,6 +1824,7 @@ public void testBug91707() throws Exception { // A::_T t; // (*t).i; // } + @Test public void testBug98961() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1796,6 +1848,7 @@ public void testBug98961() throws Exception { // } // void begin(); // }; + @Test public void testBug98784() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1811,6 +1864,7 @@ public void testBug98784() throws Exception { // void m(){ // f(A(1)); // } + @Test public void testBug99254a() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPConstructor ctor = bh.assertNonProblem("A(T t)", "A", ICPPConstructor.class); @@ -1837,6 +1891,7 @@ public void testBug99254a() throws Exception { // void f(B* b){ // b->add(core::A(10, 2)); // } + @Test public void testBug99254b() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPConstructor ctor = bh.assertNonProblem("A(T x, T y)", "A", ICPPConstructor.class); @@ -1861,6 +1916,7 @@ public void testBug99254b() throws Exception { // void f(B* b){ // b->add(A(10)); // } + @Test public void testBug99254c() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPConstructor ctor = bh.assertNonProblem("A(T)", "A", ICPPConstructor.class); @@ -1876,6 +1932,7 @@ public void testBug99254c() throws Exception { assertSame(add, add2); } + @Test public void testBug98666() throws Exception { CPPASTNameBase.sAllowNameComputation = true; IASTTranslationUnit tu = parse("A::template B b;", CPP); @@ -1896,6 +1953,7 @@ public void testBug98666() throws Exception { // template template // struct A::C::B{}; // A::C::B ab; + @Test public void testBug90678() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -1928,6 +1986,7 @@ public void testBug90678() throws Exception { // int f(int); // #2 // int k = f(1); // uses #2 // int l = f<>(1); // uses #1 + @Test public void testBug95208() throws Exception { String content = getAboveComment(); IASTTranslationUnit tu = parse(content, CPP); @@ -1957,6 +2016,7 @@ public void testBug95208() throws Exception { // const int local = 10; // A broken; // }; + @Test public void testBug103578() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -1977,6 +2037,7 @@ public void testBug103578() throws Exception { // A< B > a; // a.base; // } + @Test public void testBug103715() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2002,6 +2063,7 @@ public void testBug103715() throws Exception { // }; // void complex::f(float){ // } + @Test public void testBug74276() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2028,6 +2090,7 @@ public void testBug74276() throws Exception { // void m(){ // myType t; // } + @Test public void testBug105852() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2051,6 +2114,7 @@ public void testBug105852() throws Exception { // B k; // k.c; // } + @Test public void testBug105769() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2067,6 +2131,7 @@ public void testBug105769() throws Exception { // template <> C(char * c) : blah(c) {} // template <> C(wchar_t * c) : blah(c) {} // }; + @Test public void testBug162230() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2102,6 +2167,7 @@ public void testBug162230() throws Exception { // template< class T > class C {}; // typedef struct C CInt; + @Test public void testBug169628() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2126,6 +2192,7 @@ public void testBug169628() throws Exception { // makeClosure(this, &A::m1); // } // }; + @Test public void testBug201204() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction fn = bh.assertNonProblem("makeClosure(this", 11, ICPPFunction.class); @@ -2152,6 +2219,7 @@ public void testBug201204() throws Exception { // func(c, &C::m1); // func(d, &C::m2); // } + @Test public void testBug233889() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction fn1 = bh.assertNonProblem("func(c", 4, ICPPFunction.class); @@ -2175,6 +2243,7 @@ public void testBug233889() throws Exception { // int main(map x) { // GetPair(x, 1); // } + @Test public void testBug229917a() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction fn = bh.assertNonProblem("GetPair(x", 7, ICPPFunction.class); @@ -2192,6 +2261,7 @@ public void testBug229917a() throws Exception { // // template // typename _C::value_type GetPair(_C& collection, typename _C::value_type::first_type key); + @Test public void testBug229917b() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); IBinding b0 = bh.assertNonProblem("value_type GetPair", 10, IBinding.class); @@ -2211,6 +2281,7 @@ public void testBug229917b() throws Exception { // void f(C& str) { // str.m(); // } + @Test public void testBug232086() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction b0 = bh.assertNonProblem("m();", 1, ICPPFunction.class); @@ -2234,6 +2305,7 @@ public void testBug232086() throws Exception { // foo(a); // bar(ca); // } + @Test public void testBug214646() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); @@ -2266,6 +2338,7 @@ public void testBug214646() throws Exception { // func(a1); // func(a2); // } + @Test public void testFunctionTemplate_245049a() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction b0 = bh.assertNonProblem("func(a1)", 4, ICPPFunction.class); @@ -2289,6 +2362,7 @@ public void testFunctionTemplate_245049a() throws Exception { // func(a1); // func(a2); // } + @Test public void testFunctionTemplate_245049b() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction b0 = bh.assertNonProblem("func(a1)", 4, ICPPFunction.class); @@ -2312,6 +2386,7 @@ public void testFunctionTemplate_245049b() throws Exception { // using ns::pair; // using ns::make_pair; // pair p = make_pair(1, 2); + @Test public void testFunctionTemplateWithUsing() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("make_pair(1", 9, ICPPFunction.class); @@ -2321,6 +2396,7 @@ public void testFunctionTemplateWithUsing() throws Exception { // void main() { // f(1); // } + @Test public void testFunctionTemplateImplicitInstantiation() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -2342,6 +2418,7 @@ public void testFunctionTemplateImplicitInstantiation() throws Exception { // void test() { // waldo(+[]() {}); // } + @Test public void testFunctionTemplateWithLambdaArgument_443361() throws Exception { parseAndCheckBindings(); } @@ -2359,6 +2436,7 @@ public void testFunctionTemplateWithLambdaArgument_443361() throws Exception { // void test(B x) { // f(a(x)); // } + @Test public void testFunctionTemplate_264963() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("f(a(x));", 1, ICPPFunction.class); @@ -2374,6 +2452,7 @@ public void testFunctionTemplate_264963() throws Exception { // void test() { // f(&A::m); // } + @Test public void testFunctionTemplate_266532() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("f(&A::m);", 1, ICPPFunction.class); @@ -2390,6 +2469,7 @@ public void testFunctionTemplate_266532() throws Exception { // void test(A p) { // f(p); // } + @Test public void testFunctionTemplate_272848a() throws Exception { parseAndCheckBindings(); } @@ -2406,6 +2486,7 @@ public void testFunctionTemplate_272848a() throws Exception { // void test(A p) { // f(p); // } + @Test public void testFunctionTemplate_272848b() throws Exception { parseAndCheckBindings(); } @@ -2419,6 +2500,7 @@ public void testFunctionTemplate_272848b() throws Exception { // void test(int* x) { // f(x); // } + @Test public void testFunctionTemplate_309564() throws Exception { parseAndCheckBindings(); } @@ -2428,6 +2510,7 @@ public void testFunctionTemplate_309564() throws Exception { // void test() { // f1(&f2); // } + @Test public void testSimplifiedFunctionTemplateWithFunctionPointer_281783() throws Exception { parseAndCheckBindings(); } @@ -2445,6 +2528,7 @@ public void testSimplifiedFunctionTemplateWithFunctionPointer_281783() throws Ex // void test(A x) { // f1(x, &f2); // } + @Test public void testFunctionTemplateWithFunctionPointer_281783() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("f1(x, &f2);", 2, ICPPFunction.class); @@ -2471,6 +2555,7 @@ public void testFunctionTemplateWithFunctionPointer_281783() throws Exception { // // foo -> CPPMethodTemplateSpecialization // // foo -> CPPMethodInstance // } + @Test public void testCPPConstructorTemplateSpecialization() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2493,6 +2578,7 @@ public void testCPPConstructorTemplateSpecialization() throws Exception { // template const T& (max)(const T& lhs, const T& rhs) { // return (lhs < rhs ? rhs : lhs); // } + @Test public void testNestedFuncTemplatedDeclarator_bug190241() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2542,6 +2628,7 @@ public void testNestedFuncTemplatedDeclarator_bug190241() throws Exception { // }; // // void f(B::tb r) {} + @Test public void testTemplateTypedef_214447() throws Exception { CPPASTNameBase.sAllowNameComputation = true; IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2576,6 +2663,7 @@ public void testTemplateTypedef_214447() throws Exception { // }; // // void f(Vec::reference r) {} + @Test public void testRebindPattern_214447a() throws Exception { CPPASTNameBase.sAllowNameComputation = true; IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2616,6 +2704,7 @@ public void testRebindPattern_214447a() throws Exception { // }; // // void f(Vec::reference r) {} + @Test public void testRebindPattern_214447b() throws Exception { CPPASTNameBase.sAllowNameComputation = true; IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2655,6 +2744,7 @@ public void testRebindPattern_214447b() throws Exception { // }; // // void f(map::value_type r) {} + @Test public void testRebindPattern_236197() throws Exception { CPPASTNameBase.sAllowNameComputation = true; IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2687,6 +2777,7 @@ public void testRebindPattern_236197() throws Exception { // }; // // void main(Iter::iter_reference r); + @Test public void testSpecializationSelection_229218() throws Exception { CPPASTNameBase.sAllowNameComputation = true; IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2713,6 +2804,7 @@ public void testSpecializationSelection_229218() throws Exception { // struct B::type> {}; // // typename B, int>::type a; + @Test public void testSpecializationSelection_509255a() throws Exception { parseAndCheckBindings(); } @@ -2729,6 +2821,7 @@ public void testSpecializationSelection_509255a() throws Exception { // A a; // waldo(a, 1); // } + @Test public void testSpecializationSelection_509255b() throws Exception { parseAndCheckBindings(); } @@ -2800,6 +2893,7 @@ public void testSpecializationSelection_509255b() throws Exception { // void test() { // waldo(f([]() {})); // } + @Test public void testSpecializationSelection_509255c() throws Exception { parseAndCheckBindings(); } @@ -2817,6 +2911,7 @@ public void testSpecializationSelection_509255c() throws Exception { // }; // // B::b::a x; + @Test public void testDefaultTemplateParameter() throws Exception { CPPASTNameBase.sAllowNameComputation = true; IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -2847,6 +2942,7 @@ public void testDefaultTemplateParameter() throws Exception { // A x; // AI y; // AT z; + @Test public void testDefaultTemplateParameter_281781() throws Exception { parseAndCheckBindings(); } @@ -2867,6 +2963,7 @@ public void testDefaultTemplateParameter_281781() throws Exception { // D d; // foo(d); // } + @Test public void testUserDefinedConversions_224364() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction fn = bh.assertNonProblem("foo(d)", 3, ICPPFunction.class); @@ -2887,6 +2984,7 @@ public void testUserDefinedConversions_224364() throws Exception { // D d; // foo(d); // } + @Test public void testUserDefinedConversions_224364a() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction fn = bh.assertNonProblem("foo(d)", 3, ICPPFunction.class); @@ -2910,6 +3008,7 @@ public void testUserDefinedConversions_224364a() throws Exception { // Z foo(Z z) {return z;} // // Z z= foo(*new E()); + @Test public void testUserDefinedConversions_224364b() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction fn = bh.assertNonProblem("foo(*new", 3, ICPPFunction.class); @@ -2934,6 +3033,7 @@ public void testUserDefinedConversions_224364b() throws Exception { // C cx; // foo(cx); // } + @Test public void testUserDefinedConversions_226231() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPFunction fn = bh.assertNonProblem("foo(cx", 3, ICPPFunction.class); @@ -2953,6 +3053,7 @@ public void testUserDefinedConversions_226231() throws Exception { // void ref(C c) { // return foo(c); // } + @Test public void testUserDefinedConversions_239023() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertNonProblem("foo(c);", 3); @@ -2963,6 +3064,7 @@ public void testUserDefinedConversions_239023() throws Exception { // // const int i= 1; // A a1; + @Test public void testNonTypeArgumentIsIDExpression_229942a() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2982,6 +3084,7 @@ public void testNonTypeArgumentIsIDExpression_229942a() throws Exception { // // const int i= 1; // }; + @Test public void testNonTypeArgumentIsIDExpression_229942b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -2996,6 +3099,7 @@ public void testNonTypeArgumentIsIDExpression_229942b() throws Exception { // // const int i= 1; // A a1; + @Test public void testExpressionArgumentIsExpression_229942() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -3011,6 +3115,7 @@ public void testExpressionArgumentIsExpression_229942() throws Exception { // // const int i= 1; // A a1; + @Test public void testTypeIdOperatorArgumentIsUnaryExpression_229942() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -3024,6 +3129,7 @@ public void testTypeIdOperatorArgumentIsUnaryExpression_229942() throws Exceptio // template class A {}; // template< class T1, class T2, int q1, int q2> // class A< C, C > {}; + @Test public void testTemplateIdAsTemplateArgumentIsTypeId_229942() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -3054,6 +3160,7 @@ public void testTemplateIdAsTemplateArgumentIsTypeId_229942() throws Exception { // inline const A foo(const A at) { // return at; // } + @Test public void testTypeIdAsTemplateArgumentIsTypeId_229942a() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertNonProblem("T> at) {", 1); @@ -3077,6 +3184,7 @@ public void testTypeIdAsTemplateArgumentIsTypeId_229942a() throws Exception { // template // inline const void foo(void (*f)(A), T* t) { // disallowed, but we're testing the AST // } + @Test public void testTypeIdAsTemplateArgumentIsTypeId_229942b() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); NameCollector col = new NameCollector(); @@ -3093,6 +3201,7 @@ public void testTypeIdAsTemplateArgumentIsTypeId_229942b() throws Exception { // typedef int td; // template<> class Alias { // }; + @Test public void testNonAmbiguityCase_229942() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP); NameCollector col = new NameCollector(); @@ -3119,6 +3228,7 @@ public void testNonAmbiguityCase_229942() throws Exception { // // C c1; // OK since C++17 via implicit deduction guide using default template argument // C<> c2; // ok - default args + @Test public void testMissingTemplateArgumentLists() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertProblem("B b1", 1); @@ -3136,6 +3246,7 @@ public void testMissingTemplateArgumentLists() throws Exception { // template inline void TestClass::fun1(void) { // member1 = 0; // } + @Test public void testDefinitionOfClassTemplateWithNonTypeParameter() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPMethod f1 = ba.assertNonProblem("fun1(void);", 4, ICPPMethod.class); @@ -3162,6 +3273,7 @@ public void testDefinitionOfClassTemplateWithNonTypeParameter() throws Exception // void ref() { // A::B<> b; // } + @Test public void testNestedTemplateDefinitionParameter() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPTemplateTypeParameter T3a = ba.assertNonProblem("T3 f", 2, ICPPTemplateTypeParameter.class); @@ -3178,6 +3290,7 @@ public void testNestedTemplateDefinitionParameter() throws Exception { // A::X x; // A::Y y; // A::Z z; + @Test public void testNonTypeArgumentDisambiguation_233460() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPClassType b2 = ba.assertNonProblem("A", 7, ICPPClassType.class, ICPPTemplateInstance.class); @@ -3207,6 +3320,7 @@ public void testNonTypeArgumentDisambiguation_233460() throws Exception { // // A::X x; //3 should be an error // A::Y y; //4 should be an error + @Test public void testNonTypeBooleanArgumentDisambiguation() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -3238,6 +3352,7 @@ public void testNonTypeBooleanArgumentDisambiguation() throws Exception { // bar(t); // baz(); // } + @Test public void testBug207871() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -3269,6 +3384,7 @@ public void testBug207871() throws Exception { // public: // C go(); // }; + @Test public void testDeferredNonTypeArgument() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPDeferredClassInstance ci = ba.assertNonProblem("C", 4, ICPPDeferredClassInstance.class); @@ -3281,6 +3397,7 @@ public void testDeferredNonTypeArgument() throws Exception { // class A {}; // // A aint; // should be an error + @Test public void testTypeArgumentToNonTypeParameter() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertProblem("A", 6); @@ -3301,6 +3418,7 @@ public void testTypeArgumentToNonTypeParameter() throws Exception { // template // inline This::This() : That(I) { // } + @Test public void testParameterReferenceInChainInitializer_a() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -3334,6 +3452,7 @@ public void testParameterReferenceInChainInitializer_a() throws Exception { // template // inline This::This() : That() { // } + @Test public void testParameterReferenceInChainInitializer_b() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -3356,6 +3475,7 @@ public void testParameterReferenceInChainInitializer_b() throws Exception { // class A {}; // // C ca5L; + @Test public void testIntegralConversionInPartialSpecializationMatching_237914() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPTemplateInstance ctps = ba.assertNonProblem("C", 7, ICPPTemplateInstance.class, ICPPClassType.class); @@ -3376,6 +3496,7 @@ public void testIntegralConversionInPartialSpecializationMatching_237914() throw // void xx() { // ca5L.test= 0; // } + @Test public void testIntegralConversionInSpecializationMatching_237914() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPSpecialization ctps = ba.assertNonProblem("C", 7, ICPPSpecialization.class, ICPPClassType.class); @@ -3404,6 +3525,7 @@ public void testIntegralConversionInSpecializationMatching_237914() throws Excep // void test() { // waldo(1); // } + @Test public void testIntegralConversionOperator_495091a() throws Exception { parseAndCheckBindings(); } @@ -3430,6 +3552,7 @@ public void testIntegralConversionOperator_495091a() throws Exception { // void test() { // waldo(1); // } + @Test public void testIntegralConversionOperator_495091b() throws Exception { parseAndCheckBindings(); } @@ -3444,6 +3567,7 @@ public void testIntegralConversionOperator_495091b() throws Exception { // public: // B(const B& other) : A(other) {} // }; + @Test public void testChainInitializerLookupThroughDeferredClassBase() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertNonProblem("A(other", 1); @@ -3459,6 +3583,7 @@ public void testChainInitializerLookupThroughDeferredClassBase() throws Exceptio // typedef int INT; // A x = waldo([](int data) { return false; }); // } + @Test public void testLambda_430428() throws Exception { parseAndCheckBindings(); } @@ -3477,6 +3602,7 @@ public void testLambda_430428() throws Exception { // B::foo(static_cast(t)); // } // }; + @Test public void testMemberLookupThroughDeferredClassBase() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertNonProblem("foo(s", 3); @@ -3492,6 +3618,7 @@ public void testMemberLookupThroughDeferredClassBase() throws Exception { // }; // // typedef result::type waldo; + @Test public void testDependentBaseLookup_408314a() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ITypedef waldo = bh.assertNonProblem("waldo"); @@ -3514,6 +3641,7 @@ public void testDependentBaseLookup_408314a() throws Exception { // }; // // typedef A::result::type waldo; + @Test public void testDependentBaseLookup_408314b() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ITypedef waldo = bh.assertNonProblem("waldo"); @@ -3536,6 +3664,7 @@ public void testDependentBaseLookup_408314b() throws Exception { // }; // // typedef A::result::type waldo; + @Test public void testDependentBaseLookup_408314c() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ITypedef waldo = bh.assertNonProblem("waldo"); @@ -3553,6 +3682,7 @@ public void testDependentBaseLookup_408314c() throws Exception { // inline int A::bar() const { // return foo(); // } + @Test public void testMemberReferenceFromTemplatedMethodDefinition_238232() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertNonProblem("foo();", 3); @@ -3578,6 +3708,7 @@ public void testMemberReferenceFromTemplatedMethodDefinition_238232() throws Exc // typedef detail::assoc_find filter; // }; // } + @Test public void testBug238180_ArrayOutOfBounds() throws Exception { // The code above used to trigger an ArrayOutOfBoundsException parse(getAboveComment(), CPP); @@ -3597,6 +3728,7 @@ public void testBug238180_ArrayOutOfBounds() throws Exception { // typedef A type; // }; // } // detail + @Test public void testBug238180_ClassCast() throws Exception { // the code above used to trigger a ClassCastException BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); @@ -3619,6 +3751,7 @@ public void testBug238180_ClassCast() throws Exception { // void bla(int g) { // test(new X(g)); // } + @Test public void testBug239586_ClassCast() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -3627,6 +3760,7 @@ public void testBug239586_ClassCast() throws Exception { // static int x; // }; // template int CT::x = sizeof(T); + @Test public void testUsingTemplParamInInitializerOfStaticField() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPTemplateTypeParameter t = ba.assertNonProblem("T)", 1, ICPPTemplateTypeParameter.class); @@ -3651,6 +3785,7 @@ public void testUsingTemplParamInInitializerOfStaticField() throws Exception { // template <> struct Waldo<42> { typedef int type; }; // // Waldo::type foo(); // ERROR + @Test public void testDependentIdExprNamingStaticMember_508254() throws Exception { parseAndCheckBindings(); } @@ -3697,6 +3832,7 @@ public void testDependentIdExprNamingStaticMember_508254() throws Exception { // cb.b = 6; // func(cb); // } + @Test public void testTemplateMetaProgramming_245027() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ICPPMethod method = ba.assertNonProblem("method();", 6, ICPPMethod.class); @@ -3723,6 +3859,7 @@ public void testTemplateMetaProgramming_245027() throws Exception { // int x; // ns1::A<(sizeof(probe(x)) == 1)>::m(x); // } + @Test public void testNonTypeTemplateParameter_252108() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertNonProblem("x))", 1, ICPPVariable.class); @@ -3743,6 +3880,7 @@ public void testNonTypeTemplateParameter_252108() throws Exception { // > > > > > // > > > > > // type; + @Test public void testNestedArguments_246079() throws Throwable { final Throwable[] th = { null }; Thread t = new Thread() { @@ -3768,6 +3906,7 @@ public void run() { // void foo(T t); // }; // template void A::foo(T t) {} + @Test public void testBug177418() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.GNU, true); @@ -3806,6 +3945,7 @@ public void testBug177418() throws Exception { // template T * CT::instance (void) { // return new CT; // } + @Test public void testNewOfThisTemplate() throws Exception { parseAndCheckBindings(getAboveComment(), CPP); } @@ -3814,6 +3954,7 @@ public void testNewOfThisTemplate() throws Exception { // class X { // friend void f<>(int); // }; + @Test public void testFunctionSpecializationAsFriend() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -3841,6 +3982,7 @@ public void testFunctionSpecializationAsFriend() throws Exception { // template typename XT::mytype1 XT::m1() {} // template typename XT::mytype2 XT::m2() {} // XT::mytype3 XT::m3() {} + @Test public void testMethodImplWithNonDeferredType() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -3866,6 +4008,7 @@ public void testMethodImplWithNonDeferredType() throws Exception { // template void f(T); // }; // template void A::f(T){} + @Test public void testClassTemplateMemberFunctionTemplate_104262() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -3889,6 +4032,7 @@ public void testClassTemplateMemberFunctionTemplate_104262() throws Exception { // }; // template template void XT::Nested::m(V) { // } + @Test public void testQualifiedMethodTemplate() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -3918,6 +4062,7 @@ public void testQualifiedMethodTemplate() throws Exception { // void test() { // waldo(1); // } + @Test public void testMethodTemplate_497535a() throws Exception { parseAndCheckBindings(); } @@ -3940,6 +4085,7 @@ public void testMethodTemplate_497535a() throws Exception { // void test() { // waldo(1); // } + @Test public void testMethodTemplate_497535b() throws Exception { parseAndCheckBindings(); } @@ -3950,6 +4096,7 @@ public void testMethodTemplate_497535b() throws Exception { // XT xt; // xt.partial; // } + @Test public void testDefaultArgsWithPartialSpecialization() throws Exception { parseAndCheckBindings(); } @@ -3961,6 +4108,7 @@ public void testDefaultArgsWithPartialSpecialization() throws Exception { // this->a= 1; // } // }; + @Test public void testFieldReference_257186() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -3983,6 +4131,7 @@ public void testFieldReference_257186() throws Exception { // f(b); g(b); h(b); m(b); // } // }; + @Test public void testUnknownReferences_257194() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4006,6 +4155,7 @@ public void testUnknownReferences_257194() throws Exception { // v.x; v.y(); // } // }; + @Test public void testTypeOfUnknownReferences_257194a() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4031,6 +4181,7 @@ public void testTypeOfUnknownReferences_257194a() throws Exception { // v->x; v->y(); // } // }; + @Test public void testTypeOfUnknownReferences_257194b() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4056,6 +4207,7 @@ public void testTypeOfUnknownReferences_257194b() throws Exception { // typename T::F(); // } // }; + @Test public void testTypeVsExpressionInArgsOfDependentTemplateID_257194() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4094,6 +4246,7 @@ public void testTypeVsExpressionInArgsOfDependentTemplateID_257194() throws Exce // void test(B >::reference p) { // func(p); // } + @Test public void testTypedefReference_259871() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("func(p)", 4, ICPPFunction.class); @@ -4114,6 +4267,7 @@ public void testTypedefReference_259871() throws Exception { // void test() { // new C(&B::m); // } + @Test public void testTypedef() throws Exception { parseAndCheckBindings(); } @@ -4137,6 +4291,7 @@ public void testTypedef() throws Exception { // auto s2 = s1 += ""; // auto s3 = s2.append("foo"); // } + @Test public void testTypedefPreservation_380498a() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPVariable s1 = ba.assertNonProblem("s1"); @@ -4161,6 +4316,7 @@ public void testTypedefPreservation_380498a() throws Exception { // void test(const vector& v) { // auto it = v.begin(); // } + @Test public void testTypedefPreservation_380498b() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPVariable it = ba.assertNonProblem("it =", "it", ICPPVariable.class); @@ -4202,6 +4358,7 @@ public void testTypedefPreservation_380498b() throws Exception { // for (auto s : v) { // } // } + @Test public void testTypedefPreservation_380498c() throws Exception { BindingAssertionHelper ba = getAssertionHelper(); ICPPVariable s = ba.assertNonProblem("s :", "s", ICPPVariable.class); @@ -4222,6 +4379,7 @@ public void testTypedefPreservation_380498c() throws Exception { // void test(A p) { // p.waldo(); // } + @Test public void testTypeTraitWithQualifier_511143() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -4243,6 +4401,7 @@ public void testTypeTraitWithQualifier_511143() throws Exception { // new A(&B::m); // } // }; + @Test public void testNestedTemplates_259872a() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("A", 9, ICPPClassType.class); @@ -4268,6 +4427,7 @@ public void testNestedTemplates_259872a() throws Exception { // new A(&B::m); // } // }; + @Test public void testNestedTemplates_259872b() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("A", 9, ICPPClassType.class); @@ -4285,6 +4445,7 @@ public void testNestedTemplates_259872b() throws Exception { // template // DumbPtr::~DumbPtr/**/ () { // } + @Test public void testCtorWithTemplateID_259600() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4300,6 +4461,7 @@ public void testCtorWithTemplateID_259600() throws Exception { // }; // template template XT::XT/**/(X* a) {} // template template XT::XT/**/(X& a) {} + @Test public void testCtorTemplateWithTemplateID_259600() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4324,6 +4486,7 @@ public void testCtorTemplateWithTemplateID_259600() throws Exception { // void test() { // XT::TD x; // } + @Test public void testResolutionOfUnknownBindings_262163() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4358,6 +4521,7 @@ public void testResolutionOfUnknownBindings_262163() throws Exception { // void test(BasicString s) { // s.substr(0); // } + @Test public void testResolutionOfUnknownBindings_262328() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("substr(0)", 6, ICPPMethod.class); @@ -4371,6 +4535,7 @@ public void testResolutionOfUnknownBindings_262328() throws Exception { // field.m(c); // } // }; + @Test public void testResolutionOfUnknownFunctions() throws Exception { parseAndCheckBindings(); } @@ -4383,6 +4548,7 @@ public void testResolutionOfUnknownFunctions() throws Exception { // field[0].m(c); // } // }; + @Test public void testResolutionOfUnknownArrayAccess() throws Exception { parseAndCheckBindings(); } @@ -4396,6 +4562,7 @@ public void testResolutionOfUnknownArrayAccess() throws Exception { // CT x; // x.append(3, 'c'); // } + @Test public void testConflictInTemplateArgumentDeduction() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -4417,6 +4584,7 @@ public void testConflictInTemplateArgumentDeduction() throws Exception { // void test(const C& p) { // p.m(); // } + @Test public void testConversionSequence_263159() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); ICPPMethod m = bh.assertNonProblem("m();", 1, ICPPMethod.class); @@ -4437,6 +4605,7 @@ public void testConversionSequence_263159() throws Exception { // A make_A(C* p) { // return A(p); // } + @Test public void testForwardDeclarations_264109() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("A make_A(C* p) {", 4, ICPPTemplateInstance.class); @@ -4452,6 +4621,7 @@ public void testForwardDeclarations_264109() throws Exception { // int* iptr; // any(CT(iptr)); // } + @Test public void testConstructorTemplateInClassTemplate_264314() throws Exception { parseAndCheckBindings(); } @@ -4469,6 +4639,7 @@ public void testConstructorTemplateInClassTemplate_264314() throws Exception { // func(x, xint); // func(y, xy, xint); // } + @Test public void testDistinctDeferredInstances_264367() throws Exception { parseAndCheckBindings(); } @@ -4478,6 +4649,7 @@ public void testDistinctDeferredInstances_264367() throws Exception { // m(0); // ok with a conversion from 0 to T // } // }; + @Test public void testUnknownParameter_264988() throws Exception { parseAndCheckBindings(); } @@ -4489,6 +4661,7 @@ public void testUnknownParameter_264988() throws Exception { // // int x = A<0>::e; // A<0>::E y; + @Test public void testEnumeratorInTemplateInstance_265070() throws Exception { parseAndCheckBindings(); } @@ -4500,6 +4673,7 @@ public void testEnumeratorInTemplateInstance_265070() throws Exception { // CT i; // getline2(i); // } + @Test public void testAmbiguousDeclaratorInFunctionTemplate_265342() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); bh.assertNonProblem("getline2(i)", 8, ICPPTemplateInstance.class); @@ -4518,6 +4692,7 @@ public void testAmbiguousDeclaratorInFunctionTemplate_265342() throws Exception // }; // }; // }; + @Test public void testOwnerOfFriendTemplate_265671() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); IFunction f = bh.assertNonProblem("f1(", 2, IFunction.class); @@ -4551,6 +4726,7 @@ public void testOwnerOfFriendTemplate_265671() throws Exception { // f(a); // a.m(a); // } + @Test public void testOwnerOfFriendTemplateFunction_408181() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPFunction f = bh.assertNonProblemOnFirstIdentifier("f(a)"); @@ -4563,6 +4739,7 @@ public void testOwnerOfFriendTemplateFunction_408181() throws Exception { // g(t); // } // template void g(T t) {} + @Test public void testDependentNameReferencingLaterDeclaration_265926a() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); IFunction gref = bh.assertNonProblem("g(t)", 1); @@ -4588,6 +4765,7 @@ public void testDependentNameReferencingLaterDeclaration_265926a() throws Except // class C { // void a() {}; // }; + @Test public void testDependentNameReferencingLaterDeclaration_265926b() throws Exception { parseAndCheckBindings(); } @@ -4599,6 +4777,7 @@ public void testDependentNameReferencingLaterDeclaration_265926b() throws Except // xt.operator T*()->something(); // } // }; + @Test public void testDeferredConversionOperator() throws Exception { parseAndCheckBindings(); } @@ -4612,6 +4791,7 @@ public void testDeferredConversionOperator() throws Exception { // X x; // } // }; + @Test public void testFriendClassTemplate_266992() throws Exception { parseAndCheckBindings(); } @@ -4623,6 +4803,7 @@ public void testFriendClassTemplate_266992() throws Exception { // void test() { // S(a); // } + @Test public void testFunctionTemplateWithArrayReferenceParameter_269926() throws Exception { parseAndCheckBindings(); } @@ -4635,6 +4816,7 @@ public void testFunctionTemplateWithArrayReferenceParameter_269926() throws Exce // void test() { // S(a); // } + @Test public void testFunctionTemplateWithArrayReferenceParameter_394024() throws Exception { parseAndCheckBindings(); } @@ -4652,6 +4834,7 @@ public void testFunctionTemplateWithArrayReferenceParameter_394024() throws Exce // void test(B p) { // f(p); // } + @Test public void testTemplateConversionOperator_271948a() throws Exception { parseAndCheckBindings(); } @@ -4671,6 +4854,7 @@ public void testTemplateConversionOperator_271948a() throws Exception { // void test(B x) { // f(x); // } + @Test public void testTemplateConversionOperator_271948b() throws Exception { parseAndCheckBindings(); } @@ -4689,6 +4873,7 @@ public void testTemplateConversionOperator_271948b() throws Exception { // }; // // Mat x = MatExpr(); + @Test public void testOverloadedConversionOperators_550397() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -4696,6 +4881,7 @@ public void testOverloadedConversionOperators_550397() throws Exception { // template struct ST{}; // template class T> class CT {}; // typedef CT TDef; + @Test public void testUsingTemplateTemplateParameter_279619() throws Exception { parseAndCheckBindings(); } @@ -4705,6 +4891,7 @@ public void testUsingTemplateTemplateParameter_279619() throws Exception { // int a[2]; // T<2>(a); // } + @Test public void testInstantiationOfArraySize_269926() throws Exception { parseAndCheckBindings(); } @@ -4714,6 +4901,7 @@ public void testInstantiationOfArraySize_269926() throws Exception { // }; // void CT::init(void) { // } + @Test public void testMethodSpecialization_322988() throws Exception { parseAndCheckBindings(); } @@ -4775,6 +4963,7 @@ public void testMethodSpecialization_322988() throws Exception { // waldo(X()); // waldo(Y()); // } + @Test public void testInheritedConstructor_489710() throws Exception { parseAndCheckBindings(); } @@ -4788,6 +4977,7 @@ public void testInheritedConstructor_489710() throws Exception { // void test(A x) { // f(x); // } + @Test public void testInlineFriendFunction_284690() throws Exception { parseAndCheckBindings(); } @@ -4806,6 +4996,7 @@ public void testInlineFriendFunction_284690() throws Exception { // void test(A x) { // f(x); // } + @Test public void testInlineFriendFunction_287409() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -4826,6 +5017,7 @@ public void testInlineFriendFunction_287409() throws Exception { // template<> struct CreateTL { // typedef NullType Type; // }; + @Test public void testDefaultArgument_289132() throws Exception { parseAndCheckBindings(); } @@ -4838,6 +5030,7 @@ public void testDefaultArgument_289132() throws Exception { // n(); // must be a problem // } // }; + @Test public void testResolutionOfNonDependentNames_293052() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -4863,6 +5056,7 @@ public void testResolutionOfNonDependentNames_293052() throws Exception { // f4(i); // f3(&cd); // must be a problem, cd is const // } + @Test public void testArgumentDeduction_293409() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -4885,6 +5079,7 @@ public void testArgumentDeduction_293409() throws Exception { // f(ch, cchar); // f(ch, cint); // } + @Test public void testFunctionTemplateOrdering_293468() throws Exception { parseAndCheckBindings(); } @@ -4902,6 +5097,7 @@ public void testFunctionTemplateOrdering_293468() throws Exception { // const int* a; // func1 (a); // } + @Test public void testFunctionTemplateOrdering_294539() throws Exception { parseAndCheckBindings(); } @@ -4913,6 +5109,7 @@ public void testFunctionTemplateOrdering_294539() throws Exception { // int main() { // foo(0); // } + @Test public void testFunctionTemplateOrdering_DR1395_388805() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -4939,6 +5136,7 @@ public void testFunctionTemplateOrdering_DR1395_388805() throws Exception { // int main() { // foo(0); // ERROR HERE // } + @Test public void testFunctionTemplateOrdering_409094a() throws Exception { parseAndCheckBindings(); } @@ -4968,6 +5166,7 @@ public void testFunctionTemplateOrdering_409094a() throws Exception { // waldo w; // foo(w); // ERROR HERE // } + @Test public void testFunctionTemplateOrdering_409094b() throws Exception { parseAndCheckBindings(); } @@ -4981,6 +5180,7 @@ public void testFunctionTemplateOrdering_409094b() throws Exception { // a= 1 >> 2; // return a; // } + @Test public void testClosingAngleBrackets1_261268() throws Exception { parseAndCheckBindings(); } @@ -4993,6 +5193,7 @@ public void testClosingAngleBrackets1_261268() throws Exception { // a= 1 > > 3; // must be syntax error // return a; // } + @Test public void testClosingAngleBrackets2_261268() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parse(code, CPP, ScannerKind.GNU, false); @@ -5010,6 +5211,7 @@ public void testClosingAngleBrackets2_261268() throws Exception { // y= a < a >> (1+2); // binary expression // a < a >> (1+2); // binary expression via ambiguity // } + @Test public void testClosingAngleBracketsAmbiguity_261268() throws Exception { parseAndCheckBindings(); } @@ -5019,6 +5221,7 @@ public void testClosingAngleBracketsAmbiguity_261268() throws Exception { // int a=1; // a OPASSIGN(>>) 1; // } + @Test public void testTokenPasteShiftROperator_261268() throws Exception { parseAndCheckBindings(); } @@ -5031,6 +5234,7 @@ public void testTokenPasteShiftROperator_261268() throws Exception { // // X::g has the parameter type int& // X x2; // X::f has the parameter type const int& // // X::g has the parameter type const int&& + @Test public void testRValueReferences_294730() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -5060,6 +5264,7 @@ public void testRValueReferences_294730() throws Exception { // template void f5(Pack ...); // template void f6(NonPack ...); // template void f7() throw(T...); + @Test public void testFunctionParameterPacks_280909() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -5089,6 +5294,7 @@ public void testFunctionParameterPacks_280909() throws Exception { // template class C1 {}; // template class... Pack> class C2 {}; // template class C3 {}; + @Test public void testTemplateParameterPacks_280909() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -5118,6 +5324,7 @@ public void testTemplateParameterPacks_280909() throws Exception { // c.b= 1; // c.mem(); // } + @Test public void testParameterPackExpansions_280909() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -5134,6 +5341,7 @@ public void testParameterPackExpansions_280909() throws Exception { // template void f1(T*...); // template void f2(T*...); + @Test public void testTemplateParameterPacksAmbiguity_280909() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -5153,6 +5361,7 @@ public void testTemplateParameterPacksAmbiguity_280909() throws Exception { // CTx<1> b; // CTx<1,2> c; // } + @Test public void testNonTypeTemplateParameterPack_280909() throws Exception { parseAndCheckBindings(); } @@ -5160,6 +5369,7 @@ public void testNonTypeTemplateParameterPack_280909() throws Exception { // template // struct count { static const int value = sizeof...(Types); // }; + @Test public void testVariadicTemplateExamples_280909a() throws Exception { parseAndCheckBindings(); } @@ -5170,6 +5380,7 @@ public void testVariadicTemplateExamples_280909a() throws Exception { // void g() { // f(add, subtract); // } + @Test public void testVariadicTemplateExamples_280909b() throws Exception { parseAndCheckBindings(); } @@ -5179,12 +5390,14 @@ public void testVariadicTemplateExamples_280909b() throws Exception { // {public: // X(const Mixins&... mixins) : Mixins(mixins)... { } // }; + @Test public void testVariadicTemplateExamples_280909c() throws Exception { parseAndCheckBindings(); } // template class Tuple; // Types is a template type parameter pack // template struct multi array; // Dims is a non-type template parameter pack + @Test public void testVariadicTemplateExamples_280909d() throws Exception { parseAndCheckBindings(); } @@ -5195,6 +5408,7 @@ public void testVariadicTemplateExamples_280909d() throws Exception { // template class Tuple; // Tuple<>* t; // OK: Elements is empty // Tuple* u; // syntax error + @Test public void testVariadicTemplateExamples_280909e() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5215,6 +5429,7 @@ public void testVariadicTemplateExamples_280909e() throws Exception { // Y ya; // okay // Y yb; // okay // Y yc; // okay + @Test public void testVariadicTemplateExamples_280909f() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5238,6 +5453,7 @@ public void testVariadicTemplateExamples_280909f() throws Exception { // template void A::f2() {} // error // template void B::f3() {} // OK // template void B::f4() {} // error + @Test public void testVariadicTemplateExamples_280909g() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5259,6 +5475,7 @@ public void testVariadicTemplateExamples_280909g() throws Exception { // int k = g(5.6); // Y is deduced to be double, Z is deduced to an empty sequence // f(g); // Y for outer f deduced to be // } // int (*)(bool), Z is deduced to an empty sequence + @Test public void testVariadicTemplateExamples_280909h() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5280,6 +5497,7 @@ public void testVariadicTemplateExamples_280909h() throws Exception { // f("aa",3.0); // error: X cannot be deduced // f2(); // okay // } + @Test public void testVariadicTemplateExamples_280909i() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5294,6 +5512,7 @@ public void testVariadicTemplateExamples_280909i() throws Exception { // void g() { // f(0, 0, 0); // Types is the sequence int*, float*, int // } + @Test public void testVariadicTemplateExamples_280909j() throws Exception { parseAndCheckBindings(); } @@ -5305,6 +5524,7 @@ public void testVariadicTemplateExamples_280909j() throws Exception { // f(x, y, z); // Types is deduced to int, float, const int // g(x, y, z); // T1 is deduced to int, Types is deduced to float, int // } + @Test public void testVariadicTemplateExamples_280909k() throws Exception { parseAndCheckBindings(); } @@ -5322,6 +5542,7 @@ public void testVariadicTemplateExamples_280909k() throws Exception { // Y y2; // uses partial specialization. T is int&, Types contains float, double // Y y3; // uses primary template, Types contains int, float, double // int fv = f(g); // okay, Types contains int, float + @Test public void testVariadicTemplateExamples_280909n() throws Exception { parseAndCheckBindings(); } @@ -5333,6 +5554,7 @@ public void testVariadicTemplateExamples_280909n() throws Exception { // Tuple t2; // Types contains two arguments: int and float // Tuple<0> error; // Error: 0 is not a type // } + @Test public void testVariadicTemplateExamples_280909p() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5348,6 +5570,7 @@ public void testVariadicTemplateExamples_280909p() throws Exception { // f(1); // okay: args contains one int argument // f(2, 1.0); // okay: args contains two arguments, an int and a double // } + @Test public void testVariadicTemplateExamples_280909q() throws Exception { parseAndCheckBindings(); } @@ -5356,6 +5579,7 @@ public void testVariadicTemplateExamples_280909q() throws Exception { // template void g(Types... rest) { // f(&rest...); // '&rest...' is a pack expansion, '&rest' is its pattern // } + @Test public void testVariadicTemplateExamples_280909r() throws Exception { parseAndCheckBindings(); } @@ -5380,6 +5604,7 @@ public void testVariadicTemplateExamples_280909r() throws Exception { // f(args); // error: parameter pack 'args' is not expanded // f(h(args...) + args...); // okay: first 'args' expanded within h, second 'args' expanded within f. // } + @Test public void testVariadicTemplateExamples_280909s() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5413,6 +5638,7 @@ public void testVariadicTemplateExamples_280909s() throws Exception { // bool b2 = contains_waldo::value; // bool b2 = contains_waldo::value; // } + @Test public void testRecursiveVariadicTemplate_397828() throws Exception { parseAndCheckBindings(); } @@ -5423,6 +5649,7 @@ public void testRecursiveVariadicTemplate_397828() throws Exception { // }; // // int x = A<>::waldo(0); + @Test public void testVariadicTemplateWithNoArguments_422700() throws Exception { parseAndCheckBindings(); } @@ -5436,6 +5663,7 @@ public void testVariadicTemplateWithNoArguments_422700() throws Exception { // void test() { // bind(&Test::Update); // } + @Test public void testFunctionOrdering_299608() throws Exception { parseAndCheckBindings(); } @@ -5448,6 +5676,7 @@ public void testFunctionOrdering_299608() throws Exception { // f(); // f(0,0) // f(); // f(0,0) // } + @Test public void testDefaultTemplateArgsForFunctionTemplates_294730() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5465,6 +5694,7 @@ public void testDefaultTemplateArgsForFunctionTemplates_294730() throws Exceptio // template class CT {}; // extern template class CT; + @Test public void testExternTemplates_294730() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code); @@ -5486,6 +5716,7 @@ public void testExternTemplates_294730() throws Exception { // eval> eC; // error: C does not match TT in partial specialization // eval> eD; // error: D does not match TT in partial specialization // eval> eE; // error: E does not match TT in partial specialization + @Test public void testExtendingVariadicTemplateTemplateParameters_302282() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5520,6 +5751,7 @@ public void testExtendingVariadicTemplateTemplateParameters_302282() throws Exce // f(1); // g(1); // } + @Test public void testExplicitSpecializations_296427() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5545,6 +5777,7 @@ public void testExplicitSpecializations_296427() throws Exception { // }; // CT::CT() : value_(0) { // } + @Test public void testConstructorOfExplicitSpecialization() throws Exception { parseAndCheckBindings(); } @@ -5559,6 +5792,7 @@ public void testConstructorOfExplicitSpecialization() throws Exception { // void test() { // func(1); // } + @Test public void testBug306213a() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5575,6 +5809,7 @@ public void testBug306213a() throws Exception { // void test() { // func(1); // } + @Test public void testBug306213b() throws Exception { CPPASTNameBase.sAllowRecursionBindings = true; final String code = getAboveComment(); @@ -5593,6 +5828,7 @@ public void testBug306213b() throws Exception { // CT::T1 a; // CT::T2 b; // } + @Test public void testBug306213c() throws Exception { parseAndCheckBindings(); } @@ -5600,6 +5836,7 @@ public void testBug306213c() throws Exception { // template class CT {}; // template<> class CT {}; // template<> class CT {}; + @Test public void testBug311164() throws Exception { CPPASTNameBase.sAllowNameComputation = true; final String code = getAboveComment(); @@ -5630,6 +5867,7 @@ public void testBug311164() throws Exception { // NOTE: If, after refactoring some AST code, this test hangs, check // if any methods that were added during the refactoring need // to be added to ASTComparer.methodsToIgnore. + @Test public void testBug316704() throws Exception { StringBuilder code = new StringBuilder("typedef if_< bool,"); for (int i = 0; i < 50; i++) { @@ -5658,6 +5896,7 @@ public void testBug316704() throws Exception { // A a; // // } + @Test public void testBug377838() throws Exception { parseAndCheckBindings(); } @@ -5673,6 +5912,7 @@ public void testBug377838() throws Exception { // // template void N::f(int&); // template<> void N::f(long&) {} + @Test public void testInlineNamespaces_305980() throws Exception { final String code = getAboveComment(); parseAndCheckBindings(code); @@ -5709,6 +5949,7 @@ public void testInlineNamespaces_305980() throws Exception { // class X {} x; // g(x); // } + @Test public void testUnnamedTypesAsTemplateArgument_316317a() throws Exception { parseAndCheckBindings(); } @@ -5728,6 +5969,7 @@ public void testUnnamedTypesAsTemplateArgument_316317a() throws Exception { // f(unnamed_obj); // OK // f(b); // OK // } + @Test public void testUnnamedTypesAsTemplateArgument_316317b() throws Exception { parseAndCheckBindings(); } @@ -5744,6 +5986,7 @@ public void testUnnamedTypesAsTemplateArgument_316317b() throws Exception { // X x; // (x + 1)->s; // } + @Test public void testOverloadResolutionBetweenMethodTemplateAndFunction() throws Exception { parseAndCheckBindings(); } @@ -5758,6 +6001,7 @@ public void testOverloadResolutionBetweenMethodTemplateAndFunction() throws Exce // int x = sizeof(f(c)); // const int d[] = { 0 }; // int y = sizeof(f(d)); + @Test public void testOverloadedFunctionTemplate_407579() throws Exception { parseAndCheckBindings(); } @@ -5766,6 +6010,7 @@ public void testOverloadedFunctionTemplate_407579() throws Exception { // void test() { // f(1,1); // } + @Test public void testFunctionParameterPacksInNonFinalPosition_324096() throws Exception { parseAndCheckBindings(); } @@ -5779,6 +6024,7 @@ public void testFunctionParameterPacksInNonFinalPosition_324096() throws Excepti // OutStream out; // out << endl; // } + @Test public void testInstantiationOfEndl_297457() throws Exception { final String code = getAboveComment(); IASTTranslationUnit tu = parseAndCheckBindings(code); @@ -5808,6 +6054,7 @@ public void testInstantiationOfEndl_297457() throws Exception { // ostream out; // out << t << endl; // } + @Test public void testInstantiationOfEndlInTemplate_417700() throws Exception { parseAndCheckBindings(); } @@ -5818,6 +6065,7 @@ public void testInstantiationOfEndlInTemplate_417700() throws Exception { // void test() { // sort(MySort); // } + @Test public void testAdressOfUniqueTemplateInst_326076() throws Exception { parseAndCheckBindings(); } @@ -5833,6 +6081,7 @@ public void testAdressOfUniqueTemplateInst_326076() throws Exception { // f(g, '1'); // f(g, 1); // } + @Test public void testInstantiationOfFunctionTemplateWithOverloadedFunctionSetArgument_326492() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5863,6 +6112,7 @@ public void testInstantiationOfFunctionTemplateWithOverloadedFunctionSetArgument // Ptr parm; // f(parm); // } + @Test public void testADLForTemplateSpecializations_327069() throws Exception { parseAndCheckBindings(); } @@ -5873,6 +6123,7 @@ public void testADLForTemplateSpecializations_327069() throws Exception { // void x(int* (*) (int*)) { // x(f); // } + @Test public void testPartialOrderingInNonCallContext_326900() throws Exception { parseAndCheckBindings(); } @@ -5885,6 +6136,7 @@ public void testPartialOrderingInNonCallContext_326900() throws Exception { // X x; // y(x); // } + @Test public void testPartialOrderingForConversions_326900() throws Exception { parseAndCheckBindings(); } @@ -5901,6 +6153,7 @@ public void testPartialOrderingForConversions_326900() throws Exception { // L::CI l; // l.m().foo = 1; // } + @Test public void testNestedTypedefSpecialization_329795() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, CPP); @@ -5923,6 +6176,7 @@ public void testNestedTypedefSpecialization_329795() throws Exception { // TestImpl::Inner2* ptr2=ptr1->ptr2; // func(ptr2->ptr1); // } + @Test public void testSpecializationViaNotDirectlyEnclosingTemplate_333186() throws Exception { parseAndCheckBindings(); } @@ -5936,6 +6190,7 @@ public void testSpecializationViaNotDirectlyEnclosingTemplate_333186() throws Ex // // struct C {}; // template class Z{}; + @Test public void testNonTypeTemplateParameterWithTypenameKeyword_333186() throws Exception { parseAndCheckBindings(); } @@ -5943,6 +6198,7 @@ public void testNonTypeTemplateParameterWithTypenameKeyword_333186() throws Exce // template void f() { // f(); // } + @Test public void testDefaultTmplArgumentOfFunctionTemplate_333325() throws Exception { parseAndCheckBindings(); } @@ -5950,6 +6206,7 @@ public void testDefaultTmplArgumentOfFunctionTemplate_333325() throws Exception // template class X {}; // template void Y(); // X< Y > x; + @Test public void testFunctionInstanceAsTemplateArg_333529() throws Exception { parseAndCheckBindings(); } @@ -5976,6 +6233,7 @@ public void testFunctionInstanceAsTemplateArg_333529() throws Exception { // void test() { // P(C()); // } + @Test public void testFunctionInstanceAsTemplateArg_334472() throws Exception { parseAndCheckBindings(); } @@ -5986,6 +6244,7 @@ public void testFunctionInstanceAsTemplateArg_334472() throws Exception { // g(); // g(); // } + @Test public void testFunctionTemplateSignatures_335062() throws Exception { parseAndCheckBindings(); } @@ -6008,6 +6267,7 @@ public void testFunctionTemplateSignatures_335062() throws Exception { // void g() { // function(0); // ERROR HERE // } + @Test public void testSyntaxErrorInReturnTypeOfFunctionInstance_336426() throws Exception { parseAndCheckBindings(); } @@ -6016,6 +6276,7 @@ public void testSyntaxErrorInReturnTypeOfFunctionInstance_336426() throws Except // template void f(Functor functor) { // A a; // } + @Test public void testFunctionCallOnDependentName_337686() throws Exception { parseAndCheckBindings(); } @@ -6025,6 +6286,7 @@ public void testFunctionCallOnDependentName_337686() throws Exception { // auto* b = a->f; // b->g; // } + @Test public void testDependentNameWithAuto_407480() throws Exception { parseAndCheckBindings(); } @@ -6037,6 +6299,7 @@ public void testDependentNameWithAuto_407480() throws Exception { // h(s, 1); // h(s, 1, 2); // } + @Test public void testVariadicFunctionTemplate_333389() throws Exception { parseAndCheckBindings(); } @@ -6051,6 +6314,7 @@ public void testVariadicFunctionTemplate_333389() throws Exception { // g(v1); // g(v2); // } + @Test public void testFunctionWithVoidParamInTypeDeduction() throws Exception { parseAndCheckBindings(); } @@ -6068,6 +6332,7 @@ public void testFunctionWithVoidParamInTypeDeduction() throws Exception { // A(this, &B::m1); // } // }; + @Test public void testFunctionWithVoidParamInTypeDeduction_423127() throws Exception { parseAndCheckBindings(); } @@ -6087,6 +6352,7 @@ public void testFunctionWithVoidParamInTypeDeduction_423127() throws Exception { // int main() { // waldo(A()); // } + @Test public void testAddressOfMethodTargeted_509396() throws Exception { parseAndCheckBindings(); } @@ -6105,6 +6371,7 @@ public void testAddressOfMethodTargeted_509396() throws Exception { // void test() { // waldo(A()); // } + @Test public void testAddressOfMethodUntargeted_509396() throws Exception { parseAndCheckBindings(); } @@ -6127,6 +6394,7 @@ public void testAddressOfMethodUntargeted_509396() throws Exception { // iFive.e= 0; // return 0; // } + @Test public void testPartialSpecAfterExplicitInst_339475() throws Exception { parseAndCheckBindings(); } @@ -6144,6 +6412,7 @@ public void testPartialSpecAfterExplicitInst_339475() throws Exception { // S<1 && 2>::m(); // m is member of S // s<1 && 2>::f(); // f is global // } + @Test public void testTemplateIDAmbiguity_341747a() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(); IASTFunctionDefinition fdef = getDeclaration(tu, 4); @@ -6170,6 +6439,7 @@ public void testTemplateIDAmbiguity_341747a() throws Exception { // // template> struct T {}; // struct Y : T> {}; + @Test public void testTemplateIDAmbiguity_341747b() throws Exception { parseAndCheckBindings(); } @@ -6183,6 +6453,7 @@ public void testTemplateIDAmbiguity_341747b() throws Exception { // S< a::a; // a < S::a; // } + @Test public void testTemplateIDAmbiguity_341747c() throws Exception { parseAndCheckBindings(); } @@ -6196,6 +6467,7 @@ public void testTemplateIDAmbiguity_341747c() throws Exception { // S* a=0; // a->B::c; // } + @Test public void testTemplateIDAmbiguity_341747d() throws Exception { parseAndCheckBindings(); } @@ -6213,6 +6485,7 @@ public void testTemplateIDAmbiguity_341747d() throws Exception { // ft(&Foo::function); // return 0; // } + @Test public void testAddressOfMethodForInstantiation_344310() throws Exception { parseAndCheckBindings(); } @@ -6227,6 +6500,7 @@ public void testAddressOfMethodForInstantiation_344310() throws Exception { // int test() { // Subscribe(Callback(&CallMe)); // invalid arguments, symbol not // } + @Test public void testParameterAdjustementInInstantiatedFunctionType_351609() throws Exception { parseAndCheckBindings(); } @@ -6245,11 +6519,13 @@ public void testParameterAdjustementInInstantiatedFunctionType_351609() throws E // CT::ref; // CT::rref; // } + @Test public void testRRefVsRef_351927() throws Exception { parseAndCheckBindings(); } // template class A {}; + @Test public void testTemplateParameterWithoutName_352266() throws Exception { parseAndCheckBindings(); } @@ -6265,6 +6541,7 @@ public void testTemplateParameterWithoutName_352266() throws Exception { // typedef CTTP b; // typedef CTTP c; // typedef CTTP d; + @Test public void testTemplateTemplateParameterMatching_352859() throws Exception { parseAndCheckBindings(); } @@ -6273,6 +6550,7 @@ public void testTemplateTemplateParameterMatching_352859() throws Exception { // template<> int f() { // return 0; // } + @Test public void testArgumentDeductionFromReturnTypeOfExplicitSpecialization_355304() throws Exception { parseAndCheckBindings(); BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); @@ -6292,6 +6570,7 @@ public void testArgumentDeductionFromReturnTypeOfExplicitSpecialization_355304() // template class B {}; // template<> class B {}; // B fooB(); + @Test public void testExplicitSpecializationOfForbiddenAsImplicit_356818() throws Exception { parseAndCheckBindings(); } @@ -6317,6 +6596,7 @@ public void testExplicitSpecializationOfForbiddenAsImplicit_356818() throws Exce // c.f(1); // c.f(1,1); // } + @Test public void testSpecializationOfUsingDeclaration_357293() throws Exception { parseAndCheckBindings(); } @@ -6324,6 +6604,7 @@ public void testSpecializationOfUsingDeclaration_357293() throws Exception { // template struct SS {}; // template > class Cont> // Cont f() {} + @Test public void testReferenceToParameterOfTemplateTemplateParameter_357308() throws Exception { parseAndCheckBindings(); } @@ -6333,6 +6614,7 @@ public void testReferenceToParameterOfTemplateTemplateParameter_357308() throws // f(); // f<>(); // } + @Test public void testTemplateArgumentDeductionWithoutParameters_358654() throws Exception { parseAndCheckBindings(); } @@ -6361,6 +6643,7 @@ public void testTemplateArgumentDeductionWithoutParameters_358654() throws Excep // void test() { // waldo([]() { return B(); }()); // } + @Test public void testTemplateArgumentDeductionWithFunctionSet_501549() throws Exception { parseAndCheckBindings(); } @@ -6384,6 +6667,7 @@ public void testTemplateArgumentDeductionWithFunctionSet_501549() throws Excepti // typedef C r; // typedef r::s t; // t::u x; + @Test public void testBoolExpressionAsTemplateArgument_361604() throws Exception { parseAndCheckBindings(); } @@ -6396,6 +6680,7 @@ public void testBoolExpressionAsTemplateArgument_361604() throws Exception { // void m(); // }; // template void C::m() {} + @Test public void testDependentUsingDeclaration() throws Exception { parseAndCheckBindings(); } @@ -6440,6 +6725,7 @@ public void testDependentUsingDeclaration() throws Exception { // ns::C::value> a; // f(a); // }; + @Test public void testDependentExpressions_a() throws Exception { parseAndCheckBindings(); } @@ -6465,6 +6751,7 @@ public void testDependentExpressions_a() throws Exception { // }; // // B::pointer a; + @Test public void testDependentExpressions_b() throws Exception { parseAndCheckBindings(); BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); @@ -6479,6 +6766,7 @@ public void testDependentExpressions_b() throws Exception { // if (T* i = foo<0>(0)) // return; // } + @Test public void testDirectlyNestedAmbiguity_362976() throws Exception { parseAndCheckBindings(); } @@ -6501,6 +6789,7 @@ public void testDirectlyNestedAmbiguity_362976() throws Exception { // int main(){ // return MaxOfN::result; // } + @Test public void testNestedTemplateAmbiguity_363609() throws Exception { parseAndCheckBindings(); } @@ -6512,6 +6801,7 @@ public void testNestedTemplateAmbiguity_363609() throws Exception { // void test() { // B b1; // } + @Test public void testDefaultArgForNonTypeTemplateParameter_363743() throws Exception { parseAndCheckBindings(); } @@ -6534,6 +6824,7 @@ public void testDefaultArgForNonTypeTemplateParameter_363743() throws Exception // delete C< a::ptr; // delete C< A::b >::ptr; // } + @Test public void testTemplateAmbiguityInDeleteExpression_364225() throws Exception { parseAndCheckBindings(); } @@ -6541,6 +6832,7 @@ public void testTemplateAmbiguityInDeleteExpression_364225() throws Exception { // template struct a {}; // const int b = 0, c = 1; // int a::*mp6; // syntax error here + @Test public void testTemplateIDAmbiguity_445177() throws Exception { parseAndCheckBindings(); } @@ -6564,6 +6856,7 @@ public void testTemplateIDAmbiguity_445177() throws Exception { // // template // using W = typename EnableIf<(I < TupleSize>::value), int>::type; + @Test public void testTemplateIDAmbiguity_497668() throws Exception { parseAndCheckBindings(); } @@ -6573,6 +6866,7 @@ public void testTemplateIDAmbiguity_497668() throws Exception { // int main() { // foo(0); // } + @Test public void testSyntaxFailureInstantiatingFunctionTemplate_365981a() throws Exception { parseAndCheckBindings(); } @@ -6582,6 +6876,7 @@ public void testSyntaxFailureInstantiatingFunctionTemplate_365981a() throws Exce // void test() { // bar(0); // } + @Test public void testSyntaxFailureInstantiatingFunctionTemplate_365981b() throws Exception { parseAndCheckBindings(); } @@ -6594,6 +6889,7 @@ public void testSyntaxFailureInstantiatingFunctionTemplate_365981b() throws Exce // } // } // }; + @Test public void testResolvingAutoTypeWithDependentExpression_367472() throws Exception { parseAndCheckBindings(); } @@ -6611,6 +6907,7 @@ public void testResolvingAutoTypeWithDependentExpression_367472() throws Excepti // vector v; // auto x1 = begin1(v); // auto x2 = begin2(v); + @Test public void testResolvingAutoTypeWithDependentExpression_402409a() throws Exception { BindingAssertionHelper helper = new AST2AssertionHelper(getAboveComment(), true); helper.assertVariableType("x1", CommonCPPTypes.pointerToInt); @@ -6633,6 +6930,7 @@ public void testResolvingAutoTypeWithDependentExpression_402409a() throws Except // begin1(v); // begin2(v); // } + @Test public void testResolvingAutoTypeWithDependentExpression_402409b() throws Exception { parseAndCheckBindings(); } @@ -6642,6 +6940,7 @@ public void testResolvingAutoTypeWithDependentExpression_402409b() throws Except // foo(1,2,args...); // foo(args...); // } + @Test public void testPackExpansionsAsArguments_367560() throws Exception { parseAndCheckBindings(); } @@ -6654,6 +6953,7 @@ public void testPackExpansionsAsArguments_367560() throws Exception { // int main() { // A m; // } + @Test public void testDeductionForConstFunctionType_367562() throws Exception { parseAndCheckBindings(); } @@ -6665,6 +6965,7 @@ public void testDeductionForConstFunctionType_367562() throws Exception { // template struct derived : public base { // typedef typename derived::type type; // ERROR HERE // }; + @Test public void testTemplateShortNameInQualifiedName_367607() throws Exception { parseAndCheckBindings(); BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); @@ -6678,6 +6979,7 @@ public void testTemplateShortNameInQualifiedName_367607() throws Exception { // typedef int type; // }; // typedef B >::type type; // ERROR HERE + @Test public void testPartialClassTemplateSpecUsingDefaultArgument_367997() throws Exception { parseAndCheckBindings(); } @@ -6688,6 +6990,7 @@ public void testPartialClassTemplateSpecUsingDefaultArgument_367997() throws Exc // template struct foo {}; // template <> struct foo<1> { typedef int type; }; // typedef foo::type t; // ERROR HERE + @Test public void testValueForSizeofExpression_368309() throws Exception { parseAndCheckBindings(); } @@ -6713,6 +7016,7 @@ public void testValueForSizeofExpression_368309() throws Exception { // auto e = *cur; // e.x; // ERROR HERE: "Field 'x' could not be resolved" // } + @Test public void testAutoTypeWithTypedef_368311() throws Exception { BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP); IVariable v = bh.assertNonProblem("cur = r.begin()", 3); @@ -6734,6 +7038,7 @@ public void testAutoTypeWithTypedef_368311() throws Exception { // auto s = *it; // s.x; // ERROR HERE: "Field 'x' could not be resolved" // } + @Test public void testSpecializationOfClassType_368610a() throws Exception { parseAndCheckBindings(); } @@ -6752,6 +7057,7 @@ public void testSpecializationOfClassType_368610a() throws Exception { // auto s = *it; // s.x; // ERROR HERE: "Field 'x' could not be resolved" // } + @Test public void testSpecializationOfClassType_368610b() throws Exception { parseAndCheckBindings(); } @@ -6766,6 +7072,7 @@ public void testSpecializationOfClassType_368610b() throws Exception { // CT x; // x.someFunc().y; // } + @Test public void testSpecializationOfClassType_368610c() throws Exception { parseAndCheckBindings(); } @@ -6785,6 +7092,7 @@ public void testSpecializationOfClassType_368610c() throws Exception { // }; // // typedef B::result::type waldo; + @Test public void testSpecializationOfBaseClass_409078() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ITypedef waldo = bh.assertNonProblem("waldo"); @@ -6802,6 +7110,7 @@ public void testSpecializationOfBaseClass_409078() throws Exception { // }; // // B a(&A::m); + @Test public void testConstInTypeParameter_377223() throws Exception { parseAndCheckBindings(); } @@ -6850,6 +7159,7 @@ public void testConstInTypeParameter_377223() throws Exception { // }; // // typedef A type; + @Test public void testSfinae_a() throws Exception { parseAndCheckBindings(); } @@ -6882,6 +7192,7 @@ public void testSfinae_a() throws Exception { // A::get(); // A::get(); // } + @Test public void testSfinae_b() throws Exception { parseAndCheckBindings(); } @@ -6911,6 +7222,7 @@ public void testSfinae_b() throws Exception { // int *ip = nullptr; // B b1 { ip }; // B::p jp = nullptr; + @Test public void testSfinae_c() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -6946,6 +7258,7 @@ public void testSfinae_c() throws Exception { // // int b1 = C().ccc1; // C::t b2; + @Test public void testSfinae_d() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -6974,6 +7287,7 @@ public void testSfinae_d() throws Exception { // void test() { // f(); // } + @Test public void testIsPOD_367993() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -6997,6 +7311,7 @@ public void testIsPOD_367993() throws Exception { // A a; /* no error this line */ // c.callDelegate(a); /* Invalid arguments 'Candidates are: void callDelegate(A<#0,#1> &)' */ // } + @Test public void testDeductionOfNonTypeTemplateArg_372587() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -7007,6 +7322,7 @@ public void testDeductionOfNonTypeTemplateArg_372587() throws Exception { // void test() { // b(f); // } + @Test public void testFunctionSetWithNonMatchingTemplateArgs_379604() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -7023,6 +7339,7 @@ public void testFunctionSetWithNonMatchingTemplateArgs_379604() throws Exception // C::dtm v; // f(v); // } + @Test public void testPointerToMemberAsDependentExpression_391001() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -7038,6 +7355,7 @@ public void testPointerToMemberAsDependentExpression_391001() throws Exception { // struct C {}; // // typedef C<&B::x> T; + @Test public void testPointerToMemberOfTemplateClass_402861() throws Exception { parseAndCheckBindings(); } @@ -7053,6 +7371,7 @@ public void testPointerToMemberOfTemplateClass_402861() throws Exception { // }; // // List::Base<&N::node> base; + @Test public void testDependentTemplateParameterInNestedTemplate_407497() throws Exception { parseAndCheckBindings(); } @@ -7066,6 +7385,7 @@ public void testDependentTemplateParameterInNestedTemplate_407497() throws Excep // }; // // typedef enclosing::nested<>::type waldo; + @Test public void testDependentTemplateParameterInNestedTemplate_399454() throws Exception { parseAndCheckBindings(); } @@ -7081,6 +7401,7 @@ public void testDependentTemplateParameterInNestedTemplate_399454() throws Excep // Container<&memory>::iterator it; // it.test; // Field 'test' could not be resolved // } + @Test public void testAddressAsTemplateArgument_391190() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -7091,6 +7412,7 @@ public void testAddressAsTemplateArgument_391190() throws Exception { // void test(int off) { // off < CT::const_min || off > CT::const_min; // } + @Test public void testTemplateIDAmbiguity_393959() throws Exception { parseAndCheckBindings(getAboveComment(), CPP, ScannerKind.GNU); } @@ -7101,6 +7423,7 @@ public void testTemplateIDAmbiguity_393959() throws Exception { // Alias x; // } // }; + @Test public void testNestedAliasDeclarationNestingLevel() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -7122,6 +7445,7 @@ public void testNestedAliasDeclarationNestingLevel() throws Exception { // template class CT { // nesting level 0 // typedef Alias TYPE; // }; + @Test public void testAliasDeclarationNestingLevel() throws Exception { final String code = getAboveComment(); BindingAssertionHelper bh = new AST2AssertionHelper(code, true); @@ -7145,6 +7469,7 @@ public void testAliasDeclarationNestingLevel() throws Exception { // Alias myA; // myA.x = 42; // } + @Test public void testSimpleAliasDeclaration() throws Exception { parseAndCheckBindings(); @@ -7173,6 +7498,7 @@ public void testSimpleAliasDeclaration() throws Exception { // Alias myA; // myA.x = 42; // } + @Test public void testSpecifiedTemplateAliasDeclaration() throws Exception { parseAndCheckBindings(); @@ -7197,6 +7523,7 @@ public void testSpecifiedTemplateAliasDeclaration() throws Exception { // Alias myA; // myA = 42; // } + @Test public void testTemplatedAliasBasicType() throws Exception { parseAndCheckBindings(); @@ -7222,6 +7549,7 @@ public void testTemplatedAliasBasicType() throws Exception { // TAlias myA; // myA.t = 42; // } + @Test public void testTemplatedAliasDeclaration() throws Exception { parseAndCheckBindings(); @@ -7263,6 +7591,7 @@ public void testTemplatedAliasDeclaration() throws Exception { // myA.t2 = 42.0f; // myA.t3 = true; // } + @Test public void testTemplatedAliasDeclarationMultipleParameters() throws Exception { parseAndCheckBindings(); @@ -7314,6 +7643,7 @@ public void testTemplatedAliasDeclarationMultipleParameters() throws Exception { // TAlias> myA; // myA.t = S(); // } + @Test public void testTemplatedAliasDeclarationTemplateArgument() throws Exception { parseAndCheckBindings(); @@ -7338,6 +7668,7 @@ public void testTemplatedAliasDeclarationTemplateArgument() throws Exception { // S> myA; // myA.t = S(); // } + @Test public void testTemplatedAliasAsTemplateArgument() throws Exception { parseAndCheckBindings(); @@ -7362,6 +7693,7 @@ public void testTemplatedAliasAsTemplateArgument() throws Exception { // TAlias<5, 4> myA; // myA.buff[0] = 1; // } + @Test public void testTemplatedAliasDeclarationValueArgument() throws Exception { parseAndCheckBindings(); @@ -7386,6 +7718,7 @@ public void testTemplatedAliasDeclarationValueArgument() throws Exception { // TAlias<> myA; // myA.buff[0] = 1; // } + @Test public void testTemplatedAliasDefaultArguments() throws Exception { parseAndCheckBindings(); @@ -7413,6 +7746,7 @@ public void testTemplatedAliasDefaultArguments() throws Exception { // TAlias myA; // myA.t = S(); // } + @Test public void testTemplatedAliasTemplateArgument() throws Exception { parseAndCheckBindings(); @@ -7441,6 +7775,7 @@ public void testTemplatedAliasTemplateArgument() throws Exception { // S myS; // bar(myS); // } + @Test public void testTemplatedAliasAsFunctionParameter() throws Exception { parseAndCheckBindings(); @@ -7466,6 +7801,7 @@ public void testTemplatedAliasAsFunctionParameter() throws Exception { // TAlias myA; // bar(myA); // } + @Test public void testTemplatedAliasAsFunctionArgument() throws Exception { parseAndCheckBindings(); @@ -7487,6 +7823,7 @@ public void testTemplatedAliasAsFunctionArgument() throws Exception { // } // void bar(TAlias arg){ // } + @Test public void testTemplatedAliasRedefinitionOfSameFunction() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("bar(S", "bar", ICPPFunction.class); @@ -7505,6 +7842,7 @@ public void testTemplatedAliasRedefinitionOfSameFunction() throws Exception { // g(v); // f(v); // } + @Test public void testTemplatedAliasDeduction() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("g(v)", "g", ICPPFunction.class); @@ -7515,6 +7853,7 @@ public void testTemplatedAliasDeduction() throws Exception { // void foo(int) { // function f = &foo; // } + @Test public void testSimpleFunctionAliasDeclaration() throws Exception { parseAndCheckBindings(); @@ -7541,6 +7880,7 @@ public void testSimpleFunctionAliasDeclaration() throws Exception { // TAlias myA = myS; // myA.t = 42; // } + @Test public void testTemplatedAliasForTemplateReference() throws Exception { parseAndCheckBindings(); @@ -7559,6 +7899,7 @@ public void testTemplatedAliasForTemplateReference() throws Exception { // void foo(int) { // function f = &foo; // } + @Test public void testSimpleFunctionTemplateAliasDeclaration() throws Exception { parseAndCheckBindings(); @@ -7581,6 +7922,7 @@ public void testSimpleFunctionTemplateAliasDeclaration() throws Exception { // void foo(int) { // function f = &foo; // } + @Test public void testSimpleFunctionReferenceTemplateAliasDeclaration() throws Exception { parseAndCheckBindings(); @@ -7608,6 +7950,7 @@ public void testSimpleFunctionReferenceTemplateAliasDeclaration() throws Excepti // TAlias > myA; // myA.t = S(); // } + @Test public void testTemplatedAliasTemplateParameter() throws Exception { parseAndCheckBindings(); @@ -7643,6 +7986,7 @@ public void testTemplatedAliasTemplateParameter() throws Exception { // void test() { // B::Waldo<&D::m>(); // } + @Test public void testTemplatedAliasWithPointerToMember_448785() throws Exception { parseAndCheckBindings(); } @@ -7657,6 +8001,7 @@ public void testTemplatedAliasWithPointerToMember_448785() throws Exception { // } // using namespace NS; // Alias intAlias; + @Test public void testAliasDeclarationContext() throws Exception { parseAndCheckBindings(); @@ -7720,6 +8065,7 @@ public void testAliasDeclarationContext() throws Exception { // void test(E>::type v) { // f(v); // } + @Test public void testAliasTemplate_395026a() throws Exception { parseAndCheckBindings(); } @@ -7765,6 +8111,7 @@ public void testAliasTemplate_395026a() throws Exception { // E v; // f(*v[0]); // } + @Test public void testAliasTemplate_395026b() throws Exception { parseAndCheckBindings(); } @@ -7781,6 +8128,7 @@ public void testAliasTemplate_395026b() throws Exception { // void test(A* c) { // f(c); // } + @Test public void testAliasTemplate_416280_1() throws Exception { parseAndCheckBindings(); } @@ -7797,6 +8145,7 @@ public void testAliasTemplate_416280_1() throws Exception { // struct D : public A { // B b; // }; + @Test public void testAliasTemplate_416280_2() throws Exception { parseAndCheckBindings(); } @@ -7817,6 +8166,7 @@ public void testAliasTemplate_416280_2() throws Exception { // }; // // bool b = D::template AD::val; + @Test public void testAliasTemplate_486618() throws Exception { parseAndCheckBindings(); } @@ -7855,6 +8205,7 @@ public void testAliasTemplate_486618() throws Exception { // waldo3(two, one); // waldo4(two, two); // } + @Test public void testAliasTemplate_486971() throws Exception { parseAndCheckBindings(); } @@ -7914,6 +8265,7 @@ public void testAliasTemplate_486971() throws Exception { // C a; // waldo(a); // } + @Test public void testAliasTemplate_502109() throws Exception { parseAndCheckBindings(); } @@ -7928,6 +8280,7 @@ public void testAliasTemplate_502109() throws Exception { // int main() { // waldo(Alias()); // } + @Test public void testTemplateIdNamingAliasTemplateInExpression_472615() throws Exception { parseAndCheckBindings(); } @@ -7942,6 +8295,7 @@ public void testTemplateIdNamingAliasTemplateInExpression_472615() throws Except // typedef typename Traits::template rebind type; // }; // typedef Meta::type Waldo; + @Test public void testNestedAliasTemplate_488456() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ITypedef waldo = helper.assertNonProblem("Waldo"); @@ -8013,6 +8367,7 @@ public void testNestedAliasTemplate_488456() throws Exception { // F a; // f(*a[0]); // } + @Test public void testConstexprFunction_395238a() throws Exception { parseAndCheckBindings(); } @@ -8042,6 +8397,7 @@ public void testConstexprFunction_395238a() throws Exception { // // B::type x; // B::type y; + @Test public void testConstexprFunction_395238b() throws Exception { BindingAssertionHelper ah = getAssertionHelper(); ITypedef td = ah.assertNonProblem("B::type", "type", ITypedef.class); @@ -8059,6 +8415,7 @@ public void testConstexprFunction_395238b() throws Exception { // void bar() { // A::g(); // } + @Test public void testConstexprFunctionCallInTemplateArgument_332829() throws Exception { parseAndCheckBindings(); } @@ -8071,6 +8428,7 @@ public void testConstexprFunctionCallInTemplateArgument_332829() throws Exceptio // struct Waldo {}; // // Waldo w; // Syntax error + @Test public void testUniformInitializationInTemplateArgument_510010() throws Exception { parseAndCheckBindings(); } @@ -8081,6 +8439,7 @@ public void testUniformInitializationInTemplateArgument_510010() throws Exceptio // ++i; // } // } + @Test public void testRegression_510010() throws Exception { parseAndCheckBindings(); } @@ -8110,6 +8469,7 @@ public void testRegression_510010() throws Exception { // void test(int x) { // waldo(x); // } + @Test public void testConstexprMethod_489987() throws Exception { parseAndCheckBindings(); } @@ -8126,6 +8486,7 @@ public void testConstexprMethod_489987() throws Exception { // }; // struct Cat {}; // typedef S::value>::type T; + @Test public void testDependentExpressionInvolvingField_388623() throws Exception { parseAndCheckBindings(); } @@ -8138,6 +8499,7 @@ public void testDependentExpressionInvolvingField_388623() throws Exception { // int main() { // foo(S()); // } + @Test public void testSfinaeInDefaultArgument() throws Exception { parseAndCheckBindings(); } @@ -8164,6 +8526,7 @@ public void testSfinaeInDefaultArgument() throws Exception { // // constexpr int value_via_adl = f(E1); // ADL via enumeration argument finds is_augmented(E*) // constexpr int value_no_adl = g(int(E1)); // Error: no ADL performed, is_augmented(int*) is not found + @Test public void testSfinaeInDependentContext() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertVariableValue("value_via_adl", 42); @@ -8187,6 +8550,7 @@ public void testSfinaeInDependentContext() throws Exception { // }; // // const bool B = has_type::value; + @Test public void testSfinaeInNestedTypeInTemplateArgument_402257() throws Exception { BindingAssertionHelper helper = new AST2AssertionHelper(getAboveComment(), true); ICPPVariable B = helper.assertNonProblem("B"); @@ -8214,6 +8578,7 @@ public void testSfinaeInNestedTypeInTemplateArgument_402257() throws Exception { // S waldo; // A() : waldo(B{}) {} // }; + @Test public void testSfinaeInTemplatedConversionOperator_409056() throws Exception { parseAndCheckImplicitNameBindings(); } @@ -8238,6 +8603,7 @@ public void testSfinaeInTemplatedConversionOperator_409056() throws Exception { // typename enable_if::value>::type waldo(); // // auto x = waldo; + @Test public void testSfinaeWhenResolvingAddressOfFunction_429928() throws Exception { parseAndCheckBindings(); } @@ -8260,6 +8626,7 @@ public void testSfinaeWhenResolvingAddressOfFunction_429928() throws Exception { // typename enable_if::value>::type waldo(); // // auto x = waldo; + @Test public void testSfinaeInNonTypeTemplateParameter_429928() throws Exception { parseAndCheckBindings(); } @@ -8275,6 +8642,7 @@ public void testSfinaeInNonTypeTemplateParameter_429928() throws Exception { // int waldo(int p); // // int x = waldo(test(0)); + @Test public void testSfinaeInConstructorCall_430230() throws Exception { parseAndCheckBindings(); } @@ -8290,6 +8658,7 @@ public void testSfinaeInConstructorCall_430230() throws Exception { // int waldo(int p); // // int x = waldo(test(0)); + @Test public void testSfinaeInNewExpression_430230a() throws Exception { parseAndCheckBindings(); } @@ -8340,6 +8709,7 @@ public void testSfinaeInNewExpression_430230a() throws Exception { // waldo(); // // auto x = waldo; + @Test public void testSfinaeInNewExpression_430230b() throws Exception { parseAndCheckBindings(); } @@ -8357,6 +8727,7 @@ public void testSfinaeInNewExpression_430230b() throws Exception { // int waldo(int p); // // int x = waldo(test(0)); + @Test public void testSfinaeInNewExpressionWithDeletedConstructor_430230() throws Exception { parseAndCheckBindings(); } @@ -8382,6 +8753,7 @@ public void testSfinaeInNewExpressionWithDeletedConstructor_430230() throws Exce // void test() { // waldo(""); // } + @Test public void testSfinaeInIdExpression_459940() throws Exception { parseAndCheckBindings(); } @@ -8395,6 +8767,7 @@ public void testSfinaeInIdExpression_459940() throws Exception { // void test() { // waldo(1); // } + @Test public void testSfinaeInTrailingReturnType_495845() throws Exception { parseAndCheckBindings(); } @@ -8432,6 +8805,7 @@ public void testSfinaeInTrailingReturnType_495845() throws Exception { // void test() { // waldo(1); // } + @Test public void testSfinaeInTrailingReturnType_495952() throws Exception { parseAndCheckBindings(); } @@ -8444,6 +8818,7 @@ public void testSfinaeInTrailingReturnType_495952() throws Exception { // void foo() { // new M((int*)0, 0); // } + @Test public void testVariadicConstructor_395247() throws Exception { parseAndCheckBindings(); } @@ -8461,6 +8836,7 @@ public void testVariadicConstructor_395247() throws Exception { // static const int value = sizeof(waldo(f)); // }; // typedef identity::value>>::type reference; + @Test public void testDependentExpressions_395243a() throws Exception { parseAndCheckBindings(); } @@ -8489,6 +8865,7 @@ public void testDependentExpressions_395243a() throws Exception { // typedef int foo_type; // }; // traits::value>::bar_type a; + @Test public void testDependentExpressions_395243b() throws Exception { parseAndCheckBindings(); } @@ -8507,6 +8884,7 @@ public void testDependentExpressions_395243b() throws Exception { // for (auto s : v.arr) // s.foo(); // } + @Test public void testDependentExpressions_395243c() throws Exception { parseAndCheckBindings(); } @@ -8524,6 +8902,7 @@ public void testDependentExpressions_395243c() throws Exception { // x->m(); // } // }; + @Test public void testDependentExpressions_395243d() throws Exception { parseAndCheckBindings(); } @@ -8541,6 +8920,7 @@ public void testDependentExpressions_395243d() throws Exception { // void test() { // int x = C::id; // } + @Test public void testDependentEnumValue_389009() throws Exception { BindingAssertionHelper ah = getAssertionHelper(); IEnumerator binding = ah.assertNonProblem("C::id", "id"); @@ -8579,6 +8959,7 @@ public void testDependentEnumValue_389009() throws Exception { // void bar(B& v) { // v.waldo(); // } + @Test public void testArgumentDependentLookupForEnumeration_506170() throws Exception { parseAndCheckBindings(); } @@ -8588,6 +8969,7 @@ public void testArgumentDependentLookupForEnumeration_506170() throws Exception // int main() { // foo(A<0>()); // } + @Test public void testVariadicNonTypeTemplateParameter_382074() throws Exception { parseAndCheckBindings(); } @@ -8615,6 +8997,7 @@ public void testVariadicNonTypeTemplateParameter_382074() throws Exception { // meta::value>::type t; // t.bar(); // } + @Test public void testVariadicNonTypeTemplateParameter_399039() throws Exception { parseAndCheckBindings(); } @@ -8630,6 +9013,7 @@ public void testVariadicNonTypeTemplateParameter_399039() throws Exception { // typedef int type; // }; // typedef common_type::type type; + @Test public void testClassTemplateSpecializationPartialOrdering_398044a() throws Exception { parseAndCheckBindings(); } @@ -8645,6 +9029,7 @@ public void testClassTemplateSpecializationPartialOrdering_398044a() throws Exce // int main() { // A mf; // } + @Test public void testClassTemplateSpecializationPartialOrdering_398044b() throws Exception { parseAndCheckBindings(); } @@ -8658,6 +9043,7 @@ public void testClassTemplateSpecializationPartialOrdering_398044b() throws Exce // struct waldo; // // typedef waldo::type Type; + @Test public void testPartialSpecializationForVarargFunctionType_402807() throws Exception { parseAndCheckBindings(); } @@ -8671,6 +9057,7 @@ public void testPartialSpecializationForVarargFunctionType_402807() throws Excep // struct waldo; // // typedef waldo::type Type; + @Test public void testPartialSpecializationForRefQualifiedFunctionType_485888() throws Exception { parseAndCheckBindings(); } @@ -8692,6 +9079,7 @@ public void testPartialSpecializationForRefQualifiedFunctionType_485888() throws // using ActualType = term_traits::value_type; // // using ExpectedType = char[4]; + @Test public void testQualifierTypeThatCollapsesAfterTypedefSubstitution_487698() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ITypedef actualType = helper.assertNonProblem("ActualType"); @@ -8719,6 +9107,7 @@ public void testQualifierTypeThatCollapsesAfterTypedefSubstitution_487698() thro // void test() { // push_back(0); // } + @Test public void testRegression_399142() throws Exception { parseAndCheckBindings(); } @@ -8735,6 +9124,7 @@ public void testRegression_399142() throws Exception { // int main() { // W::value>::type w; // } + @Test public void testDependentExpressionInvolvingFieldInNestedClass_399362() throws Exception { parseAndCheckBindings(); } @@ -8753,6 +9143,7 @@ public void testDependentExpressionInvolvingFieldInNestedClass_399362() throws E // }; // // typedef decltype(W()()) waldo; + @Test public void testInstantiationOfConstMemberAccess_409107() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); IType waldo = bh.assertNonProblem("waldo"); @@ -8794,6 +9185,7 @@ public void testInstantiationOfConstMemberAccess_409107() throws Exception { // int main() { // S::value>::type t; // } + @Test public void testVariadicTemplates_401024() throws Exception { parseAndCheckBindings(); } @@ -8811,6 +9203,7 @@ public void testVariadicTemplates_401024() throws Exception { // S s; // bar(foo(s(0))); // } + @Test public void testVariadicTemplatesAndFunctionObjects_401479() throws Exception { parseAndCheckBindings(); } @@ -8846,6 +9239,7 @@ public void testVariadicTemplatesAndFunctionObjects_401479() throws Exception { // void test() { // waldo(""); // } + @Test public void testPackExpansionInNestedTemplate_459844() throws Exception { parseAndCheckBindings(); } @@ -8857,6 +9251,7 @@ public void testPackExpansionInNestedTemplate_459844() throws Exception { // struct C : A... {}; // // constexpr bool answer = __is_base_of(A, C); + @Test public void testPackExpansionInBaseSpecifier_487703() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable answer = helper.assertNonProblem("answer"); @@ -8870,6 +9265,7 @@ public void testPackExpansionInBaseSpecifier_487703() throws Exception { // struct SpecificMixin {}; // // constexpr bool answer = __is_base_of(SpecificMixin, C); + @Test public void testTemplateTemplateParameterPack_487703a() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable answer = helper.assertNonProblem("answer"); @@ -8884,6 +9280,7 @@ public void testTemplateTemplateParameterPack_487703a() throws Exception { // // typedef C Waldo; // constexpr bool answer = __is_base_of(SpecificMixin, Waldo); + @Test public void testTemplateTemplateParameterPack_487703b() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable answer = helper.assertNonProblem("answer"); @@ -8906,6 +9303,7 @@ public void testTemplateTemplateParameterPack_487703b() throws Exception { // N::impl::type operand; // operand.kind(); // } + @Test public void testNameLookupInDependentExpression_399829a() throws Exception { parseAndCheckBindings(); } @@ -8930,6 +9328,7 @@ public void testNameLookupInDependentExpression_399829a() throws Exception { // N::impl::type operand; // operand.kind(); // } + @Test public void testNameLookupInDependentExpression_399829b() throws Exception { parseAndCheckBindings(); } @@ -8953,6 +9352,7 @@ public void testNameLookupInDependentExpression_399829b() throws Exception { // S operator==(T, T*); // template // S<(is_int::value)> operator==(T, T); + @Test public void testRegression_399829() throws Exception { parseAndCheckBindings(); } @@ -8968,6 +9368,7 @@ public void testRegression_399829() throws Exception { // S s; // auto waldo = bar(&s); // } + @Test public void testDependentFieldReference_472436a() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableType("waldo", CommonCPPTypes.int_); @@ -8987,6 +9388,7 @@ public void testDependentFieldReference_472436a() throws Exception { // S s; // auto waldo = bar(&s); // } + @Test public void testDependentFieldReference_472436b() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableType("waldo", CommonCPPTypes.int_); @@ -9009,6 +9411,7 @@ public void testDependentFieldReference_472436b() throws Exception { // S s; // bind(s, 0, foo); // } + @Test public void testNPE_401140() throws Exception { BindingAssertionHelper helper = new AST2AssertionHelper(getAboveComment(), true); helper.assertProblem("bind(s, 0, foo)", "bind"); @@ -9028,6 +9431,7 @@ public void testNPE_401140() throws Exception { // int foo(void*, S* = 0); // // int value = sizeof(foo(0)); + @Test public void testNPE_395074() throws Exception { parseAndCheckBindings(); } @@ -9038,6 +9442,7 @@ public void testNPE_395074() throws Exception { // int combine(S1&& r1, S2&& r2); // template // auto combine(S1 r1, S2 r2) -> decltype(combine(forward(r1), forward(r2))); + @Test public void testUnsupportedOperationExceptionInASTAmbiguousNode_402085() throws Exception { parseAndCheckBindings(); } @@ -9057,6 +9462,7 @@ public void testUnsupportedOperationExceptionInASTAmbiguousNode_402085() throws // int main() { // S::value>::type t; // } + @Test public void testVariadicNonTypeTemplateParameter_401142() throws Exception { parseAndCheckBindings(); } @@ -9079,6 +9485,7 @@ public void testVariadicNonTypeTemplateParameter_401142() throws Exception { // int main() { // S::value>::type t; // } + @Test public void testVariadicNonTypeTemplateParameter_401400() throws Exception { parseAndCheckBindings(); } @@ -9088,6 +9495,7 @@ public void testVariadicNonTypeTemplateParameter_401400() throws Exception { // static constexpr int i = sizeof...(Args); // }; // constexpr int bar = foo::i; + @Test public void testSizeofParameterPackOnTypeid_401973() throws Exception { BindingAssertionHelper helper = new AST2AssertionHelper(getAboveComment(), true); ICPPVariable bar = helper.assertNonProblem("bar"); @@ -9115,6 +9523,7 @@ public void testSizeofParameterPackOnTypeid_401973() throws Exception { // typedef typename make_tuple_indices<1 + sizeof...(Args), 1>::type Index; // } // }; + @Test public void testVariadicTemplatesNPE_401743() throws Exception { parseAndCheckBindings(); } @@ -9131,6 +9540,7 @@ public void testVariadicTemplatesNPE_401743() throws Exception { // S<> s; // s.waldo(0, 0); // ERROR HERE // } + @Test public void testParameterPackInNestedTemplate_441028() throws Exception { parseAndCheckBindings(); } @@ -9153,6 +9563,7 @@ public void testParameterPackInNestedTemplate_441028() throws Exception { // }; // // prober, 0>::t>::t g(); + @Test public void testParameterPack_485806() throws Exception { parseAndCheckBindings(); } @@ -9163,6 +9574,7 @@ public void testParameterPack_485806() throws Exception { // int main() { // waldo(); // } + @Test public void testExplicitArgumentsForParameterPack_404245() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertProblem("waldo()", "waldo"); @@ -9180,6 +9592,7 @@ public void testExplicitArgumentsForParameterPack_404245() throws Exception { // void foo2(A... t) { // bar(t.waldo...); // } + @Test public void testMemberAccessInPackExpansion_442213() throws Exception { parseAndCheckBindings(); } @@ -9208,6 +9621,7 @@ public void testMemberAccessInPackExpansion_442213() throws Exception { // void foo1(const T&... t) { // bar(t.waldo...); // } + @Test public void testMemberAccessViaReferenceInPackExpansion_466845() throws Exception { parseAndCheckBindings(); } @@ -9230,6 +9644,7 @@ public void testMemberAccessViaReferenceInPackExpansion_466845() throws Exceptio // A a; // waldo(a, C<>()); // } + @Test public void testDecltypeInPackExpansion_486425a() throws Exception { parseAndCheckBindings(); } @@ -9252,6 +9667,7 @@ public void testDecltypeInPackExpansion_486425a() throws Exception { // A a; // waldo(a, C<>()); // } + @Test public void testDecltypeInPackExpansion_486425b() throws Exception { parseAndCheckBindings(); } @@ -9266,6 +9682,7 @@ public void testDecltypeInPackExpansion_486425b() throws Exception { // decltype(__declval()) declval(); // // using T = decltype(declval()); + @Test public void testDeclvalDeclaration_540957() throws Exception { parseAndCheckBindings(); } @@ -9284,6 +9701,7 @@ public void testDeclvalDeclaration_540957() throws Exception { // int main() { // async(); // ERROR: Invalid arguments // } + @Test public void testDependentPackExpansionInFunctionType_526684() throws Exception { parseAndCheckBindings(); } @@ -9300,6 +9718,7 @@ public void testDependentPackExpansionInFunctionType_526684() throws Exception { // }; // // typedef tuple_element::type Waldo; + @Test public void testSizeofParameterPack_527697() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ITypedef waldo = helper.assertNonProblem("Waldo"); @@ -9324,6 +9743,7 @@ public void testSizeofParameterPack_527697() throws Exception { // int main() { // function<0>(); // } + @Test public void testSizeofParameterPack_574196() throws Exception { parseAndCheckBindings(); } @@ -9346,6 +9766,7 @@ public void testSizeofParameterPack_574196() throws Exception { // int main() { // function<0>(); // } + @Test public void testSizeofParameterPack_574196_2() throws Exception { parseAndCheckBindings(); } @@ -9368,6 +9789,7 @@ public void testSizeofParameterPack_574196_2() throws Exception { // int main() { // function<0>(); // } + @Test public void testSizeofParameterPack_574196_3() throws Exception { parseAndCheckBindings(); } @@ -9390,6 +9812,7 @@ public void testSizeofParameterPack_574196_3() throws Exception { // int main() { // function<0>(); // } + @Test public void testSizeofParameterPack_574196_4() throws Exception { parseAndCheckBindings(); } @@ -9435,6 +9858,7 @@ public void testSizeofParameterPack_574196_4() throws Exception { // int main() { // function<1234>(); // } + @Test public void testSizeofParameterPack_574196_6() throws Exception { parseAndCheckBindings(); } @@ -9451,6 +9875,7 @@ public void testSizeofParameterPack_574196_6() throws Exception { // B b; // waldo(b); // } + @Test public void testTemplateArgumentDeduction_MultipleInheritance_527697() throws Exception { parseAndCheckBindings(); } @@ -9471,6 +9896,7 @@ public void testTemplateArgumentDeduction_MultipleInheritance_527697() throws Ex // typedef A> D; // // typedef B::type E; + @Test public void testRegression_401743a() throws Exception { parseAndCheckBindings(); } @@ -9493,6 +9919,7 @@ public void testRegression_401743a() throws Exception { // typedef A> D; // // typedef B::type E; + @Test public void testRegression_401743b() throws Exception { parseAndCheckBindings(); } @@ -9516,6 +9943,7 @@ public void testRegression_401743b() throws Exception { // C::pointer p; // p->a = 0; // } + @Test public void testPseudoRecursiveTypedef_408314() throws Exception { CPPASTNameBase.sAllowRecursionBindings = true; parseAndCheckBindings(); @@ -9525,6 +9953,7 @@ public void testPseudoRecursiveTypedef_408314() throws Exception { // void foo(T t) { // bar(t); // } + @Test public void testUnqualifiedFunctionCallInTemplate_402498a() throws Exception { parseAndCheckBindings(); } @@ -9540,6 +9969,7 @@ public void testUnqualifiedFunctionCallInTemplate_402498a() throws Exception { // int main() { // auto x = foo(N::A()); // } + @Test public void testUnqualifiedFunctionCallInTemplate_402498b() throws Exception { new AST2AssertionHelper(getAboveComment(), true).assertVariableType("x", CommonCPPTypes.int_); } @@ -9556,6 +9986,7 @@ public void testUnqualifiedFunctionCallInTemplate_402498b() throws Exception { // int main() { // auto x = foo(N::A()); // } + @Test public void testUnqualifiedFunctionCallInTemplate_402498c() throws Exception { BindingAssertionHelper helper = new AST2AssertionHelper(getAboveComment(), true); ICPPVariable x = helper.assertNonProblem("x"); @@ -9585,6 +10016,7 @@ public void testUnqualifiedFunctionCallInTemplate_402498c() throws Exception { // auto x = foo(N::A()); // x.woof(); // } + @Test public void testUnqualifiedFunctionCallInTemplate_402498d() throws Exception { parseAndCheckBindings(); } @@ -9595,6 +10027,7 @@ public void testUnqualifiedFunctionCallInTemplate_402498d() throws Exception { // void foo(T t) { // bar(t); // } + @Test public void testUnqualifiedFunctionCallInTemplate_458316a() throws Exception { parseAndCheckBindings(); } @@ -9615,6 +10048,7 @@ public void testUnqualifiedFunctionCallInTemplate_458316a() throws Exception { // int main() { // foo(N::S()).meow(); // } + @Test public void testUnqualifiedFunctionCallInTemplate_458316b() throws Exception { parseAndCheckBindings(); } @@ -9635,6 +10069,7 @@ public void testUnqualifiedFunctionCallInTemplate_458316b() throws Exception { // // A a; // auto b = foo(a); + @Test public void testQualifiedNameLookupInTemplate_402854() throws Exception { BindingAssertionHelper helper = new AST2AssertionHelper(getAboveComment(), true); helper.assertVariableType("b", CommonCPPTypes.int_); @@ -9647,6 +10082,7 @@ public void testQualifiedNameLookupInTemplate_402854() throws Exception { // struct B : public A { // B(int c) : A(c) {} // }; + @Test public void testTemplateBaseClassConstructorCall_402602() throws Exception { parseAndCheckBindings(); } @@ -9661,6 +10097,7 @@ public void testTemplateBaseClassConstructorCall_402602() throws Exception { // private: // int privateMemberVariable; // }; + @Test public void testTemplateMemberAccessibility() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -9692,6 +10129,7 @@ public void testTemplateMemberAccessibility() throws Exception { // private: // int specializedPrivateVariable; // }; + @Test public void testTemplateSpecializationMemberAccessibility() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -9727,6 +10165,7 @@ public void testTemplateSpecializationMemberAccessibility() throws Exception { // a->protectedMemberVariable = 0; // a->privateMemberVariable = 0; // } + @Test public void testInstanceMemberAccessibility() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); @@ -9776,6 +10215,7 @@ public void testInstanceMemberAccessibility() throws Exception { // int main() { // foo(); // } + @Test public void testInstantiationOfTypedef_412555() throws Exception { parseAndCheckBindings(); } @@ -9793,6 +10233,7 @@ public void testInstantiationOfTypedef_412555() throws Exception { // // template // void A, T>::method() {} + @Test public void testOutOfLineMethodOfPartialSpecialization_401152() throws Exception { parseAndCheckBindings(); } @@ -9812,6 +10253,7 @@ public void testOutOfLineMethodOfPartialSpecialization_401152() throws Exception // int main() { // U::type x; // } + @Test public void testDependentDecltypeInNameQualifier_415198() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertNonProblem("decltype(foo(T()))::type"); @@ -9828,6 +10270,7 @@ public void testDependentDecltypeInNameQualifier_415198() throws Exception { // }; // // decltype(B::c)::type x; + @Test public void testDependentDecltypeInNameQualifier_429837() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); assertSameType((ITypedef) helper.assertNonProblem("decltype(B::c)::type"), CommonCPPTypes.int_); @@ -9849,6 +10292,7 @@ public void testDependentDecltypeInNameQualifier_429837() throws Exception { // template // void C::waldo() {} // } + @Test public void testMemberOfPartialSpecialization_416788() throws Exception { parseAndCheckBindings(); } @@ -9874,6 +10318,7 @@ public void testMemberOfPartialSpecialization_416788() throws Exception { // myObject.method<0>(); // return 0; // } + @Test public void testSpecializedEnumerator_418770() throws Exception { parseAndCheckBindings(); } @@ -9890,6 +10335,7 @@ public void testSpecializedEnumerator_418770() throws Exception { // class A { // friend int ns::waldo(const A&); // }; + @Test public void testDependentSpecializationOfFunctionTemplateAsFriend_422505a() throws Exception { parseAndCheckBindings(); } @@ -9904,6 +10350,7 @@ public void testDependentSpecializationOfFunctionTemplateAsFriend_422505a() thro // class A { // friend int waldo(const A&); // }; + @Test public void testDependentSpecializationOfFunctionTemplateAsFriend_422505b() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertNonProblem("waldo", ICPPDeferredFunction.class); @@ -9931,6 +10378,7 @@ public void testDependentSpecializationOfFunctionTemplateAsFriend_422505b() thro // A a; // waldo(a); // } + @Test public void testDependentFunctionSet_485985() throws Exception { parseAndCheckBindings(); } @@ -9954,6 +10402,7 @@ public void testDependentFunctionSet_485985() throws Exception { // void test() { // waldo(0); // } + @Test public void testDependentConversionOperator_486149() throws Exception { parseAndCheckBindings(); } @@ -9968,6 +10417,7 @@ public void testDependentConversionOperator_486149() throws Exception { // }; // // constexpr bool waldo = negate(boolean()); + @Test public void testDependentConversionOperator_486426() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPVariable waldo = helper.assertNonProblem("waldo"); @@ -9986,6 +10436,7 @@ public void testDependentConversionOperator_486426() throws Exception { // }; // // constexpr int waldo = S::b; + @Test public void testDependentConditionalExpression_506170() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertVariableValue("waldo", 42); @@ -10004,6 +10455,7 @@ public void testDependentConditionalExpression_506170() throws Exception { // C x; // waldo(x, x); // } + @Test public void testStrayFriends_419301() throws Exception { parseAndCheckBindings(); } @@ -10025,6 +10477,7 @@ public void testStrayFriends_419301() throws Exception { // void test() { // waldo(foo(c, d)); // } + @Test public void testInstantiationOfFriendOfNestedClassInsideTemplate_484162() throws Exception { parseAndCheckBindings(); } @@ -10040,6 +10493,7 @@ public void testInstantiationOfFriendOfNestedClassInsideTemplate_484162() throws // } // // constexpr unsigned waldo = t(0u); + @Test public void testSpecializationOfConstexprFunction_420995() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); ICPPVariable waldo = helper.assertNonProblem("waldo"); @@ -10065,6 +10519,7 @@ public void testSpecializationOfConstexprFunction_420995() throws Exception { // } // // }; + @Test public void testConstexprFunctionCallWithNonConstexprArguments_429891() throws Exception { parseAndCheckBindings(); } @@ -10083,6 +10538,7 @@ public void testConstexprFunctionCallWithNonConstexprArguments_429891() throws E // } // // constexpr int waldo = foo(); + @Test public void testInstantiationOfReturnExpression_484959() throws Exception { getAssertionHelper().assertVariableValue("waldo", 42); } @@ -10105,6 +10561,7 @@ public void testInstantiationOfReturnExpression_484959() throws Exception { // template // struct C3 { typedef B type; }; // C3<>::type c3; + @Test public void testNameLookupInDefaultTemplateArgument_399145() throws Exception { parseAndCheckBindings(); } @@ -10133,6 +10590,7 @@ public void testNameLookupInDefaultTemplateArgument_399145() throws Exception { // g(a); // } // } + @Test public void testLocalTypeAsTemplateArgument_442832() throws Exception { parseAndCheckBindings(); } @@ -10154,6 +10612,7 @@ public void testLocalTypeAsTemplateArgument_442832() throws Exception { // Bar var1; // auto var2 = foo(S()); // } + @Test public void testTypeOfUnknownMember_447728() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); IVariable var1 = helper.assertNonProblem("var1"); @@ -10166,6 +10625,7 @@ public void testTypeOfUnknownMember_447728() throws Exception { // typedef decltype(T::member) C; // typedef decltype(C::member) D; // } + @Test public void testScopeOfUnkownMemberType_525982() throws Exception { parseAndCheckBindings(); } @@ -10200,6 +10660,7 @@ public void testScopeOfUnkownMemberType_525982() throws Exception { // S s; // s.waldo = 42; // } + @Test public void testClassSpecializationInEnumerator_457511() throws Exception { parseAndCheckBindings(); } @@ -10212,6 +10673,7 @@ public void testClassSpecializationInEnumerator_457511() throws Exception { // // using type = TypeTemplate>; // }; + @Test public void testAmbiguityResolutionOrder_462348a() throws Exception { parseAndCheckBindings(); } @@ -10226,6 +10688,7 @@ public void testAmbiguityResolutionOrder_462348a() throws Exception { // using type = TypeTemplate>; // }; // }; + @Test public void testAmbiguityResolutionOrder_462348b() throws Exception { parseAndCheckBindings(); } @@ -10277,6 +10740,7 @@ public void testAmbiguityResolutionOrder_462348b() throws Exception { // B b; // b.method(); // } + @Test public void testAmbiguityResolution_469788() throws Exception { parseAndCheckBindings(); } @@ -10302,6 +10766,7 @@ public void _testAmbiguityResolution_497931() throws Exception { // template // static S waldo(int); // }; + @Test public void testAmbiguityResolutionInNestedClassMethodBody_485388() throws Exception { parseAndCheckBindings(); } @@ -10319,6 +10784,7 @@ public void testAmbiguityResolutionInNestedClassMethodBody_485388() throws Excep // // template