summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/instantiate-using-decl.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-12-15 18:49:47 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-12-15 18:49:47 +0000
commit77212133072dc40f070a280af8217032f55a9eb4 (patch)
tree2fd5819f49caecc5f520219b6b9254fe94ebb138 /test/SemaTemplate/instantiate-using-decl.cpp
parent4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa (diff)
downloadFreeBSD-src-77212133072dc40f070a280af8217032f55a9eb4.zip
FreeBSD-src-77212133072dc40f070a280af8217032f55a9eb4.tar.gz
Update clang to 91430.
Diffstat (limited to 'test/SemaTemplate/instantiate-using-decl.cpp')
-rw-r--r--test/SemaTemplate/instantiate-using-decl.cpp63
1 files changed, 46 insertions, 17 deletions
diff --git a/test/SemaTemplate/instantiate-using-decl.cpp b/test/SemaTemplate/instantiate-using-decl.cpp
index a1cf355..de66f79 100644
--- a/test/SemaTemplate/instantiate-using-decl.cpp
+++ b/test/SemaTemplate/instantiate-using-decl.cpp
@@ -1,20 +1,49 @@
// RUN: clang-cc -fsyntax-only -verify %s
-namespace N { }
-
-template<typename T>
-struct A {
- void f();
-};
-
-template<typename T>
-struct B : A<T> {
- using A<T>::f;
-
- void g() {
- using namespace N;
- f();
- }
-};
+namespace test0 {
+ namespace N { }
+
+ template<typename T>
+ struct A {
+ void f();
+ };
+
+ template<typename T>
+ struct B : A<T> {
+ using A<T>::f;
+
+ void g() {
+ using namespace N;
+ f();
+ }
+ };
+
+ template struct B<int>;
+}
-template struct B<int>;
+namespace test1 {
+ template <class Derived> struct Visitor1 {
+ void Visit(struct Object1*);
+ };
+ template <class Derived> struct Visitor2 {
+ void Visit(struct Object2*); // expected-note {{candidate function}}
+ };
+
+ template <class Derived> struct JoinVisitor
+ : Visitor1<Derived>, Visitor2<Derived> {
+ typedef Visitor1<Derived> Base1;
+ typedef Visitor2<Derived> Base2;
+
+ void Visit(struct Object1*); // expected-note {{candidate function}}
+ using Base2::Visit;
+ };
+
+ class Knot : JoinVisitor<Knot> {
+ };
+
+ void test() {
+ Knot().Visit((struct Object1*) 0);
+ Knot().Visit((struct Object2*) 0);
+ Knot().Visit((struct Object3*) 0); // expected-error {{no matching member function for call}}
+ }
+}
OpenPOWER on IntegriCloud