Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2012-01-14 16:25:19 -0500
committerMarc-Andre Laperle2012-01-14 16:50:28 -0500
commitd98768295b4ad9f212dfd55c84b53ae9a2cab4ca (patch)
tree80ae09ca683b1b6917ac795c03d8e8166b33b7a6 /codan/org.eclipse.cdt.codan.core.test
parent59c4d10629cf7e8567ffb9759022212654c58615 (diff)
downloadorg.eclipse.cdt-d98768295b4ad9f212dfd55c84b53ae9a2cab4ca.tar.gz
org.eclipse.cdt-d98768295b4ad9f212dfd55c84b53ae9a2cab4ca.tar.xz
org.eclipse.cdt-d98768295b4ad9f212dfd55c84b53ae9a2cab4ca.zip
Bug 368446 - NonVirtualDestructor checker: stack overflow when class
inherits itself
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.java16
1 files changed, 15 insertions, 1 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 2e5c88d899..edecd93c06 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Patrick Hofer and others.
+ * Copyright (c) 2011, 2012 Patrick Hofer and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -181,4 +181,18 @@ public class NonVirtualDestructorCheckerTest extends CheckerTestCase {
loadCodeAndRun(getAboveComment());
checkErrorLines(4);
}
+
+ // class C : public C {};
+ public void testBug368446_stackOverflow() throws Exception {
+ loadCodeAndRun(getAboveComment());
+ checkNoErrors();
+ }
+
+ // class B;
+ // class A : public B {};
+ // class B : public A {};
+ public void testBug368446_stackOverflow_indirect() throws Exception {
+ loadCodeAndRun(getAboveComment());
+ checkNoErrors();
+ }
}

Back to the top