Skip to main content
summaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorNathan Ridge2013-07-24 06:09:31 +0000
committerSergey Prigogin2013-07-28 20:15:45 +0000
commit266e36403abcedec29241f6f38eab7616e6820d3 (patch)
treef23f40e54ec768bc2925f7778ba881828d89ca3e /codan
parente03dc2bcd16476810ebc0fcab1c2dcbc0f5bfde7 (diff)
downloadorg.eclipse.cdt-266e36403abcedec29241f6f38eab7616e6820d3.tar.gz
org.eclipse.cdt-266e36403abcedec29241f6f38eab7616e6820d3.tar.xz
org.eclipse.cdt-266e36403abcedec29241f6f38eab7616e6820d3.zip
Bug 351612 - Pure virtual implementation not recognized if multiply
inherited Change-Id: I1e9141fbb5cc72bb7b59b77d6faf958726094e5f Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/14906 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java
index 207fa0f0220..df33e42fd17 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/AbstractClassInstantiationCheckerTest.java
@@ -258,4 +258,58 @@ public class AbstractClassInstantiationCheckerTest extends CheckerTestCase {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
+
+ // struct MyInterface {
+ // virtual void doIt() = 0;
+ // };
+ //
+ // struct Empty: virtual public MyInterface {};
+ //
+ // struct Implementer: virtual public MyInterface {
+ // virtual void doIt();
+ // };
+ //
+ // struct Multiple: public Empty, public Implementer {};
+ //
+ // static Multiple sharedMultiple;
+ public void testDiamondInheritanceWithOneImplementor_bug351612a() {
+ loadCodeAndRun(getAboveComment());
+ checkNoErrors();
+ }
+
+ // struct MyInterface {
+ // virtual void doIt() = 0;
+ // };
+ //
+ // struct Empty: virtual public MyInterface {};
+ //
+ // struct Implementer: public MyInterface {
+ // virtual void doIt();
+ // };
+ //
+ // struct Multiple: public Empty, public Implementer {};
+ //
+ // static Multiple sharedMultiple;
+ public void testDiamondInheritanceWithOneImplementor_bug351612b() {
+ loadCodeAndRun(getAboveComment());
+ checkErrorLine(13);
+ }
+
+ // struct MyInterface {
+ // virtual void doIt() = 0;
+ // };
+ //
+ // struct Empty: public MyInterface {};
+ //
+ // struct Implementer: virtual public MyInterface {
+ // virtual void doIt();
+ // };
+ //
+ // struct Multiple: public Empty, public Implementer {};
+ //
+ // static Multiple sharedMultiple;
+ public void testDiamondInheritanceWithOneImplementor_bug351612c() {
+ loadCodeAndRun(getAboveComment());
+ checkErrorLine(13);
+ }
}

Back to the top