Douglas Gregor | 48c89f4 | 2010-04-24 16:38:41 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | namespace PR6915 { |
| 4 | template <typename T> |
| 5 | class D { |
| 6 | enum T::X v; // expected-error{{use of 'X' with tag type that does not match previous declaration}} \ |
| 7 | // expected-error{{no enum named 'X' in 'PR6915::D3'}} |
| 8 | }; |
| 9 | |
| 10 | struct D1 { |
| 11 | enum X { value }; |
| 12 | }; |
| 13 | struct D2 { |
| 14 | class X { }; // expected-note{{previous use is here}} |
| 15 | }; |
| 16 | struct D3 { }; |
| 17 | |
| 18 | template class D<D1>; |
| 19 | template class D<D2>; // expected-note{{in instantiation of}} |
| 20 | template class D<D3>; // expected-note{{in instantiation of}} |
| 21 | } |
| 22 | |
| 23 | template<typename T> |
| 24 | struct DeclOrDef { |
| 25 | enum T::foo; // expected-error{{nested name specifier for a declaration cannot depend on a template parameter}} |
| 26 | enum T::bar { // expected-error{{nested name specifier for a declaration cannot depend on a template parameter}} |
| 27 | value |
| 28 | }; |
| 29 | }; |
| 30 | |
| 31 | namespace PR6649 { |
| 32 | template <typename T> struct foo { |
| 33 | class T::bar; // expected-error{{nested name specifier for a declaration cannot depend on a template parameter}} |
Douglas Gregor | c70e93c | 2010-04-24 16:40:35 +0000 | [diff] [blame] | 34 | class T::bar { int x; }; // expected-error{{nested name specifier for a declaration cannot depend on a template parameter}} |
Douglas Gregor | 48c89f4 | 2010-04-24 16:38:41 +0000 | [diff] [blame] | 35 | }; |
| 36 | } |
John McCall | a25c408 | 2010-10-19 18:40:57 +0000 | [diff] [blame] | 37 | |
| 38 | namespace rdar8568507 { |
| 39 | template <class T> struct A *makeA(T t); |
| 40 | } |