summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/vtable-layout.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-12 06:15:07 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-12 06:15:07 +0000
commit84c416b9f64c977cf29ef800ac83bb0a25ff4212 (patch)
tree812cf79289d70b22763b983e087012fe7d6fb855 /clang/test/CodeGenCXX/vtable-layout.cpp
parent87b4b4184ceb7b4324808cbc2e4ff3eed463e13f (diff)
downloadbcm5719-llvm-84c416b9f64c977cf29ef800ac83bb0a25ff4212.tar.gz
bcm5719-llvm-84c416b9f64c977cf29ef800ac83bb0a25ff4212.zip
Fix a bug causing an assertion when a covariant return type differed from
an overriden type only by reduced qualification. llvm-svn: 95968
Diffstat (limited to 'clang/test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r--clang/test/CodeGenCXX/vtable-layout.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/vtable-layout.cpp b/clang/test/CodeGenCXX/vtable-layout.cpp
index f7db2135d2f..6cc1b0b691e 100644
--- a/clang/test/CodeGenCXX/vtable-layout.cpp
+++ b/clang/test/CodeGenCXX/vtable-layout.cpp
@@ -113,3 +113,13 @@ struct D : B {
void D::f() { }
}
+
+// For now, just verify this doesn't crash.
+namespace test0 {
+ struct Obj {};
+
+ struct Base { virtual const Obj *foo() = 0; };
+ struct Derived : Base { virtual Obj *foo() { return new Obj(); } };
+
+ void test(Derived *D) { D->foo(); }
+}
OpenPOWER on IntegriCloud