Francois Pichet | ef04ecf | 2011-11-11 00:12:11 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s |
Francois Pichet | 0f74d1e | 2011-09-07 00:14:57 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | template <class T> |
| 5 | class A { |
| 6 | public: |
| 7 | void f(T a) { }// expected-note {{must qualify identifier to find this declaration in dependent base class}} |
| 8 | void g();// expected-note {{must qualify identifier to find this declaration in dependent base class}} |
| 9 | }; |
| 10 | |
| 11 | |
| 12 | template <class T> |
| 13 | class B : public A<T> { |
| 14 | public: |
| 15 | void z(T a) |
| 16 | { |
| 17 | f(a); // expected-warning {{use of identifier 'f' found via unqualified lookup into dependent bases of class templates is a Microsoft extension}} |
| 18 | g(); // expected-warning {{use of identifier 'g' found via unqualified lookup into dependent bases of class templates is a Microsoft extension}} |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | template class B<int>; // expected-note {{requested here}} |
| 23 | template class B<char>; |
| 24 | |
| 25 | void test() |
| 26 | { |
| 27 | B<int> b; |
| 28 | b.z(3); |
| 29 | } |
| 30 | |
Francois Pichet | ef04ecf | 2011-11-11 00:12:11 +0000 | [diff] [blame^] | 31 | namespace lookup_dependent_bases_id_expr { |
| 32 | |
| 33 | template<class T> class A { |
| 34 | public: |
| 35 | int var; |
| 36 | }; |
| 37 | |
| 38 | |
| 39 | template<class T> |
| 40 | class B : public A<T> { |
| 41 | public: |
| 42 | void f() { |
| 43 | var = 3; |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | template class B<int>; |
| 48 | |
| 49 | } |
Francois Pichet | 0f74d1e | 2011-09-07 00:14:57 +0000 | [diff] [blame] | 50 | |