Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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