blob: 7b91f9a3ed3f728d5af01c0933373cb0710e414b [file] [log] [blame]
Richard Trieu910515b2012-11-07 21:17:13 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3template<typename T> class vector2 {};
4template<typename T> class vector : vector2<T> {};
5
6template<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'}}
7template<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
9void 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 Gregor0162c1c2013-03-26 23:36:30 +000013
14namespace 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}