Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-07-24 02:09:31 -0400
committerSergey Prigogin2013-07-28 15:35:20 -0400
commit5fb92e3cf8cff344cd447234f6c2d6dc5239a642 (patch)
treed428976590615f5069377fd40adc9838a97a7a6f /codan/org.eclipse.cdt.codan.core.test
parentb947a9816cad4e5266e5b423238d1ce28ec8d642 (diff)
downloadorg.eclipse.cdt-5fb92e3cf8cff344cd447234f6c2d6dc5239a642.tar.gz
org.eclipse.cdt-5fb92e3cf8cff344cd447234f6c2d6dc5239a642.tar.xz
org.eclipse.cdt-5fb92e3cf8cff344cd447234f6c2d6dc5239a642.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/org.eclipse.cdt.codan.core.test')
-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 207fa0f022..df33e42fd1 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