Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2009-05-25 04:02:37 -0400
committerAnton Leherbauer2009-05-25 04:02:37 -0400
commit2bf225f6df74823a94ce16ac241821e28f51b34a (patch)
tree169b9a3ffb6b25ffd01539da2f97d44eff04fb73 /core/org.eclipse.cdt.core.tests
parentd6767953a968d788f5c34706a2fdae70f618b4c1 (diff)
downloadorg.eclipse.cdt-2bf225f6df74823a94ce16ac241821e28f51b34a.tar.gz
org.eclipse.cdt-2bf225f6df74823a94ce16ac241821e28f51b34a.tar.xz
org.eclipse.cdt-2bf225f6df74823a94ce16ac241821e28f51b34a.zip
Bug 274490 - Return type stored in the ICElement- IFunctionDeclaration contains method qualifiers as well
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelBuilderBugsTest.java9
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cmodel/CModelBuilderTest.cpp4
2 files changed, 13 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelBuilderBugsTest.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelBuilderBugsTest.java
index 2180e1f9447..cb1008d6fec 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelBuilderBugsTest.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelBuilderBugsTest.java
@@ -15,6 +15,7 @@ import junit.framework.Test;
import org.eclipse.cdt.core.dom.IPDOMManager;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.IFunctionDeclaration;
import org.eclipse.cdt.core.model.INamespace;
import org.eclipse.cdt.core.model.IStructure;
import org.eclipse.cdt.core.model.ITranslationUnit;
@@ -67,4 +68,12 @@ public class CModelBuilderBugsTest extends BaseTestCase {
assertEquals("decl", functions[1].getElementName());
}
+ public void testModelBuilderBug274490() throws Exception {
+ IStructure clazz= (IStructure) fTU.getElement("Bug274490");
+ assertNotNull(clazz);
+ ICElement[] methods= clazz.getChildren();
+ assertEquals(2, methods.length);
+ assertEquals("int", ((IFunctionDeclaration) methods[0]).getReturnType());
+ assertEquals("const char*", ((IFunctionDeclaration) methods[1]).getReturnType());
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/CModelBuilderTest.cpp b/core/org.eclipse.cdt.core.tests/resources/cmodel/CModelBuilderTest.cpp
index 35a7f1f8086..c876b0e79b7 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cmodel/CModelBuilderTest.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/cmodel/CModelBuilderTest.cpp
@@ -10,3 +10,7 @@ namespace nsTest {
void nsTest::inlined2() {}; // wrong label in outline: nsTest::inlined(): void
void nsTest::decl2(); // label in outline (ok): decl(): void
}
+class Bug274490 {
+ virtual int m();
+ inline const char* m2() const;
+};

Back to the top