blob: a4394aa21f6e50b690963bd5faca3a86e58587e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
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>;
}
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}}
}
}
// PR5847
namespace test2 {
namespace ns {
void foo();
}
template <class T> void bar(T* ptr) {
using ns::foo;
foo();
}
template void bar(char *);
}
|