Chandler Carruth | 444eaa8 | 2010-05-11 08:02:08 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // This is the function actually selected during overload resolution, and the |
| 4 | // only one defined. |
| 5 | template <typename T> void f(T*, int) {} |
| 6 | |
| 7 | template <typename T> struct S; |
| 8 | template <typename T> struct S_ : S<T> { typedef int type; }; // expected-note{{in instantiation}} |
| 9 | template <typename T> struct S { |
| 10 | // Force T to have a complete type here so we can observe instantiations with |
| 11 | // incomplete types. |
| 12 | T t; // expected-error{{field has incomplete type}} |
| 13 | }; |
| 14 | |
| 15 | // Provide a bad class and an overload that instantiates templates with it. |
| 16 | class NoDefinition; // expected-note{{forward declaration}} |
| 17 | template <typename T> S_<NoDefinition>::type f(T*, NoDefinition*); // expected-note{{in instantiation}} |
| 18 | |
| 19 | void test(int x) { |
| 20 | f(&x, 0); |
| 21 | } |