Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Felber2012-05-23 23:14:49 -0400
committerSergey Prigogin2012-05-23 23:14:49 -0400
commit3ae34a03448b92365e000241a0987a2b4ecf29dc (patch)
treebf8319dd373f0194a17beeba267f1063ea1a64ce /core/org.eclipse.cdt.core.tests
parentfab94256f09f7112170f4bc3096894ecd84b2669 (diff)
downloadorg.eclipse.cdt-3ae34a03448b92365e000241a0987a2b4ecf29dc.tar.gz
org.eclipse.cdt-3ae34a03448b92365e000241a0987a2b4ecf29dc.tar.xz
org.eclipse.cdt-3ae34a03448b92365e000241a0987a2b4ecf29dc.zip
Bug 379511 - Forward declaration in function parameter ignored by
translation unit. Modified patch by Lukas Felber.
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index 2ec49ee183..ceb452abbd 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -27,6 +27,7 @@ import java.util.Iterator;
import junit.framework.TestSuite;
+import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
@@ -9684,4 +9685,13 @@ public class AST2CPPTests extends AST2BaseTest {
f= bh.assertNonProblem("f( 0 )", 1);
assertEquals("void (int)", ASTTypeUtil.getType(f.getType()));
}
+
+ // void foo(struct S s);
+ public void testParameterForwardDeclaration_379511() throws Exception {
+ BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
+ ICPPClassType struct= bh.assertNonProblem("S", 1, ICPPClassType.class);
+ IName[] declarations= bh.getTranslationUnit().getDeclarations(struct);
+ assertEquals(1, declarations.length);
+ assertEquals(bh.findName("S", 1), declarations[0]);
+ }
}

Back to the top