Douglas Gregor | 7429654 | 2009-02-27 19:31:52 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | template<typename T, typename U = const T> struct Def1; |
| 4 | |
| 5 | template<> struct Def1<int> { |
| 6 | void foo(); |
| 7 | }; |
| 8 | |
| 9 | template<> struct Def1<const int> { // expected-note{{previous definition is here}} |
| 10 | void bar(); |
| 11 | }; |
| 12 | |
| 13 | void test_Def1(Def1<int, const int> *d1, Def1<const int, const int> *d2) { |
| 14 | d1->foo(); |
| 15 | d2->bar(); |
| 16 | } |
| 17 | |
| 18 | template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1'}} |
| 19 | |