summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/vtable-key-function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/vtable-key-function.cpp')
-rw-r--r--test/CodeGenCXX/vtable-key-function.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-key-function.cpp b/test/CodeGenCXX/vtable-key-function.cpp
index 90e8ea6..97a546f 100644
--- a/test/CodeGenCXX/vtable-key-function.cpp
+++ b/test/CodeGenCXX/vtable-key-function.cpp
@@ -13,3 +13,21 @@ struct A {
A::A() { }
A::A(int) { }
}
+
+// Make sure that we don't assert when building the vtable for a class
+// template specialization or explicit instantiation with a key
+// function.
+template<typename T>
+struct Base {
+ virtual ~Base();
+};
+
+template<typename T>
+struct Derived : public Base<T> { };
+
+template<>
+struct Derived<char> : public Base<char> {
+ virtual void anchor();
+};
+
+void Derived<char>::anchor() { }
OpenPOWER on IntegriCloud