From 5fb92e3cf8cff344cd447234f6c2d6dc5239a642 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Wed, 24 Jul 2013 02:09:31 -0400 Subject: Bug 351612 - Pure virtual implementation not recognized if multiply inherited Change-Id: I1e9141fbb5cc72bb7b59b77d6faf958726094e5f Signed-off-by: Nathan Ridge Reviewed-on: https://git.eclipse.org/r/14906 Reviewed-by: Sergey Prigogin IP-Clean: Sergey Prigogin Tested-by: Sergey Prigogin --- .../AbstractClassInstantiationCheckerTest.java | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'codan/org.eclipse.cdt.codan.core.test') 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); + } } -- cgit v1.2.3