Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | 7f43d67 | 2009-02-25 23:52:28 +0000 | [diff] [blame] | 2 | namespace N { |
Douglas Gregor | 2943aed | 2009-03-03 04:44:36 +0000 | [diff] [blame] | 3 | template<typename T> class A { }; |
Douglas Gregor | 7f43d67 | 2009-02-25 23:52:28 +0000 | [diff] [blame] | 4 | |
| 5 | template<> class A<int> { }; |
| 6 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 7 | template<> class A<float>; // expected-note{{forward declaration of 'N::A<float>'}} |
Douglas Gregor | 2943aed | 2009-03-03 04:44:36 +0000 | [diff] [blame] | 8 | |
Douglas Gregor | 7f43d67 | 2009-02-25 23:52:28 +0000 | [diff] [blame] | 9 | class B : public A<int> { }; |
| 10 | } |
| 11 | |
| 12 | class C1 : public N::A<int> { }; |
| 13 | |
Douglas Gregor | 2943aed | 2009-03-03 04:44:36 +0000 | [diff] [blame] | 14 | class C2 : public N::A<float> { }; // expected-error{{base class has incomplete type}} |
Douglas Gregor | 7f43d67 | 2009-02-25 23:52:28 +0000 | [diff] [blame] | 15 | |
| 16 | struct D1 { |
| 17 | operator N::A<int>(); |
| 18 | }; |
| 19 | |
| 20 | namespace N { |
| 21 | struct D2 { |
| 22 | operator A<int>(); |
| 23 | }; |
| 24 | } |