summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/virtual-override.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/virtual-override.cpp')
-rw-r--r--clang/test/SemaCXX/virtual-override.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/virtual-override.cpp b/clang/test/SemaCXX/virtual-override.cpp
index 6024dae8386..cee64568cd8 100644
--- a/clang/test/SemaCXX/virtual-override.cpp
+++ b/clang/test/SemaCXX/virtual-override.cpp
@@ -115,13 +115,25 @@ class X1 : public X0 {
template <typename Base>
struct Foo : Base {
- void f() = 0; // expected-error{{not virtual and cannot be declared pure}}
+ void f(int) = 0; // expected-error{{not virtual and cannot be declared pure}}
};
-struct Base1 { virtual void f(); };
+struct Base1 { virtual void f(int); };
struct Base2 { };
void test() {
Foo<Base1> f1;
Foo<Base2> f2; // expected-note{{instantiation}}
}
+
+template<typename Base>
+struct Foo2 : Base {
+ template<typename T> int f(T);
+};
+
+void test2() {
+ Foo2<Base1> f1;
+ Foo2<Base2> f2;
+ f1.f(17);
+ f2.f(17);
+};
OpenPOWER on IntegriCloud