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