aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-02-15 22:12:26 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-02-15 22:12:26 +0000
commit17e0f407d56748da21050db13ff3a093b1ffdcb7 (patch)
tree795b6cc95f2e646bec4fb06df9d10083e056938d /test
parent44703f59ed2ae7854a08cf67cb2474c31e0698ec (diff)
Fix instantiation of template functions with local classes that contain virtual
methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaTemplate/instantiate-local-class.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-local-class.cpp b/test/SemaTemplate/instantiate-local-class.cpp
index 768eb2170a..72ad90a04f 100644
--- a/test/SemaTemplate/instantiate-local-class.cpp
+++ b/test/SemaTemplate/instantiate-local-class.cpp
@@ -32,3 +32,21 @@ namespace PR5764 {
}
}
+// Instantiation of local classes with virtual functions.
+namespace local_class_with_virtual_functions {
+ template <typename T> struct X { };
+ template <typename T> struct Y { };
+
+ template <typename T>
+ void f() {
+ struct Z : public X<Y<T>*> {
+ virtual void g(Y<T>* y) { }
+ void g2(int x) {(void)x;}
+ };
+ Z z;
+ (void)z;
+ }
+
+ struct S { };
+ void test() { f<S>(); }
+}