Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2011-07-17 22:02:26 -0400
committerSergey Prigogin2011-07-17 22:07:56 -0400
commitd3264a74180ab0306d5dd217da409bf309031ff5 (patch)
treed155c3f7bcd6518be1b11bb78421ae86f61c6dd7 /codan/org.eclipse.cdt.codan.core.test
parent21e056c85659a76f88f4a26de0e0704c9ed1756a (diff)
downloadorg.eclipse.cdt-d3264a74180ab0306d5dd217da409bf309031ff5.tar.gz
org.eclipse.cdt-d3264a74180ab0306d5dd217da409bf309031ff5.tar.xz
org.eclipse.cdt-d3264a74180ab0306d5dd217da409bf309031ff5.zip
Removed an invalid exemption for abstract classes.
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/NonVirtualDestructorCheckerTest.java23
1 files changed, 5 insertions, 18 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java
index 4a587027b8..2e5c88d899 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/NonVirtualDestructorCheckerTest.java
@@ -7,6 +7,8 @@
*
* Contributors:
* Patrick Hofer - Initial API and implementation
+ * Tomasz Wesolowski
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.codan.core.internal.checkers;
@@ -143,9 +145,7 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
checkErrorLines(3, 7, 11, 13);
}
- // class A { // OK. Do _not_ warn here.
- // // A is an abstract class because it has one pure virtual method.
- // // A cannot be instantiated.
+ // class A {
// virtual void f1() { };
// virtual void f2() = 0;
// };
@@ -157,7 +157,8 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
// };
public void testAbstractBaseClass() {
loadCodeAndRun(getAboveComment());
- checkNoErrors();
+ // It doesn't matter if the class is abstract or not - dtor can be called polymorphically.
+ checkErrorLines(1);
}
// struct Base {
@@ -180,18 +181,4 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
}
-
- // struct IBase {
- // virtual void foo() = 0;
- // };
- // struct IDerived : IBase {
- // };
- // struct ADerived : IDerived {
- // void foo();
- // virtual void bar() = 0;
- // };
- public void testInheritedAbstractClasses() {
- loadCodeAndRun(getAboveComment());
- checkNoErrors();
- }
}

Back to the top