blob: a76b34fda26334191e218d71c3827c016e7f3e09 [file] [log] [blame]
Richard Trieu23bafad2012-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 Gregor45bb4832013-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}
Matt Beaumont-Gay76d0b462013-06-21 18:58:32 +000031
32namespace PR16292 {
33 class IncompleteClass; // expected-note{{forward declaration}}
34 class BaseClass {
35 IncompleteClass Foo; // expected-error{{field has incomplete type}}
36 };
37 template<class T> class DerivedClass : public BaseClass {};
38 void* p = new DerivedClass<void>;
39}