Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2005-05-10 15:13:14 +0000
committerAndrew Niefer2005-05-10 15:13:14 +0000
commitadf20e84c7af767214cfc7d1a92cb575925d24a4 (patch)
treec1a618915799f3bf7e5b675e4b87ae8f3339e9b4
parente2e8b4439d6730803bf32bc45de685a49558a923 (diff)
downloadorg.eclipse.cdt-adf20e84c7af767214cfc7d1a92cb575925d24a4.tar.gz
org.eclipse.cdt-adf20e84c7af767214cfc7d1a92cb575925d24a4.tar.xz
org.eclipse.cdt-adf20e84c7af767214cfc7d1a92cb575925d24a4.zip
update AST spec tests
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecFailingTest.java47
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecTest.java48
2 files changed, 48 insertions, 47 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecFailingTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecFailingTest.java
index f42f190628e..67f58cd9d3b 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecFailingTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecFailingTest.java
@@ -42,53 +42,6 @@ public class AST2CPPSpecFailingTest extends AST2SpecBaseTest {
}
/**
- [--Start Example(CPP 3.2-5):
- // translation unit 1:
- struct X {
- X(int);
- X(int, int);
- };
- X::X(int = 0) { }
- class D: public X { };
- D d2; // X(int) called by D()
- // translation unit 2:
- struct X {
- X(int);
- X(int, int);
- };
- X::X(int = 0, int = 0) { }
- class D: public X { }; // X(int, int) called by D();
- // D()’s implicit definition
- // violates the ODR
- --End Example]
- */
- public void test3_2s5() { // TODO raised bug 90602
- StringBuffer buffer = new StringBuffer();
- buffer.append("// translation unit 1:\n"); //$NON-NLS-1$
- buffer.append("struct X {\n"); //$NON-NLS-1$
- buffer.append("X(int);\n"); //$NON-NLS-1$
- buffer.append("X(int, int);\n"); //$NON-NLS-1$
- buffer.append("};\n"); //$NON-NLS-1$
- buffer.append("X::X(int = 0) { }\n"); //$NON-NLS-1$
- buffer.append("class D: public X { };\n"); //$NON-NLS-1$
- buffer.append("D d2; // X(int) called by D()\n"); //$NON-NLS-1$
- buffer.append("// translation unit 2:\n"); //$NON-NLS-1$
- buffer.append("struct X {\n"); //$NON-NLS-1$
- buffer.append("X(int);\n"); //$NON-NLS-1$
- buffer.append("X(int, int);\n"); //$NON-NLS-1$
- buffer.append("};\n"); //$NON-NLS-1$
- buffer.append("X::X(int = 0, int = 0) { }\n"); //$NON-NLS-1$
- buffer.append("class D: public X { }; // X(int, int) called by D();\n"); //$NON-NLS-1$
- buffer.append("// D()’s implicit definition\n"); //$NON-NLS-1$
- buffer.append("// violates the ODR\n"); //$NON-NLS-1$
- try{
- parse(buffer.toString(), ParserLanguage.CPP, true, 0);
- assertTrue(false);
- } catch (Exception e) {
- }
- }
-
- /**
[--Start Example(CPP 3.4.1-10):
struct A {
typedef int AT;
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 f0719fa6bb4..742f60ee25a 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
@@ -180,6 +180,54 @@ public class AST2CPPSpecTest extends AST2SpecBaseTest {
}
/**
+ [--Start Example(CPP 3.2-5):
+ // translation unit 1:
+ struct X {
+ X(int);
+ X(int, int);
+ };
+ X::X(int = 0) { }
+ class D: public X { };
+ D d2; // X(int) called by D()
+ // translation unit 2:
+ struct X {
+ X(int);
+ X(int, int);
+ };
+ X::X(int = 0, int = 0) { }
+ class D: public X { }; // X(int, int) called by D();
+ // D()’s implicit definition
+ // violates the ODR
+ --End Example]
+ */
+ public void test3_2s5() throws Exception {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("// translation unit 1:\n"); //$NON-NLS-1$
+ buffer.append("struct X {\n"); //$NON-NLS-1$
+ buffer.append("X(int);\n"); //$NON-NLS-1$
+ buffer.append("X(int, int);\n"); //$NON-NLS-1$
+ buffer.append("};\n"); //$NON-NLS-1$
+ buffer.append("X::X(int = 0) { }\n"); //$NON-NLS-1$
+ buffer.append("class D: public X { };\n"); //$NON-NLS-1$
+ buffer.append("D d2; // X(int) called by D()\n"); //$NON-NLS-1$
+
+ parse(buffer.toString(), ParserLanguage.CPP, true, 0);
+
+ buffer = new StringBuffer();
+ buffer.append("// translation unit 2:\n"); //$NON-NLS-1$
+ buffer.append("struct X {\n"); //$NON-NLS-1$
+ buffer.append("X(int);\n"); //$NON-NLS-1$
+ buffer.append("X(int, int);\n"); //$NON-NLS-1$
+ buffer.append("};\n"); //$NON-NLS-1$
+ buffer.append("X::X(int = 0, int = 0) { }\n"); //$NON-NLS-1$
+ buffer.append("class D: public X { }; // X(int, int) called by D();\n"); //$NON-NLS-1$
+ buffer.append("// D()’s implicit definition\n"); //$NON-NLS-1$
+ buffer.append("// violates the ODR\n"); //$NON-NLS-1$
+
+ parse(buffer.toString(), ParserLanguage.CPP, true, 0);
+ }
+
+ /**
[--Start Example(CPP 3.3-2):
int j = 24;
int main()

Back to the top