Richard Trieu | 910515b | 2012-11-07 21:17:13 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | template<typename T> class vector2 {}; |
| 4 | template<typename T> class vector : vector2<T> {}; |
| 5 | |
| 6 | template<typename T> void Foo2(vector2<const T*> V) {} // expected-note{{candidate template ignored: can't deduce a type for 'T' which would make 'const T' equal 'int'}} |
| 7 | template<typename T> void Foo(vector<const T*> V) {} // expected-note {{candidate template ignored: can't deduce a type for 'T' which would make 'const T' equal 'int'}} |
| 8 | |
| 9 | void test() { |
| 10 | Foo2(vector2<int*>()); // expected-error{{no matching function for call to 'Foo2'}} |
| 11 | Foo(vector<int*>()); // expected-error{{no matching function for call to 'Foo'}} |
| 12 | } |
Douglas Gregor | 0162c1c | 2013-03-26 23:36:30 +0000 | [diff] [blame^] | 13 | |
| 14 | namespace rdar13267210 { |
| 15 | template < typename T > class A { |
| 16 | BaseTy; // expected-error{{C++ requires a type specifier for all declarations}} |
| 17 | }; |
| 18 | |
| 19 | template < typename T, int N > class C: A < T > {}; |
| 20 | |
| 21 | class B { |
| 22 | C<long, 16> ExternalDefinitions; |
| 23 | C<long, 64> &Record; |
| 24 | |
| 25 | void AddSourceLocation(A<long> &R); // expected-note{{passing argument to parameter 'R' here}} |
| 26 | void AddTemplateKWAndArgsInfo() { |
| 27 | AddSourceLocation(Record); // expected-error{{non-const lvalue reference to type}} |
| 28 | } |
| 29 | }; |
| 30 | } |