blob: 8f2876ce4b32ac8823ccb11ac6de38ae26b6c901 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3template<typename T> struct A {
4 void f() { }
5 struct N { }; // expected-note{{target of using declaration}}
6};
7
8template<typename T> struct B : A<T> {
9 using A<T>::f;
10 using A<T>::N; // expected-error{{dependent using declaration resolved to type without 'typename'}}
11
12 using A<T>::foo; // expected-error{{no member named 'foo'}}
13 using A<double>::f; // expected-error{{using declaration refers into 'A<double>::', which is not a base class of 'B<int>'}}
14};
15
16B<int> a; // expected-note{{in instantiation of template class 'struct B<int>' requested here}}
17
18template<typename T> struct C : A<T> {
19 using A<T>::f;
20
21 void f() { };
22};
23
24template <typename T> struct D : A<T> {
25 using A<T>::f;
26
27 void f();
28};
29
30template<typename T> void D<T>::f() { }
31
32template<typename T> struct E : A<T> {
33 using A<T>::f;
34
35 void g() { f(); }
36};
37
38namespace test0 {
39 struct Base {
40 int foo;
41 };
42 template<typename T> struct E : Base {
43 using Base::foo;
44 };
45
46 template struct E<int>;
47}