blob: 4e6cd24111c47a727aa9a33c7f23b75ebc465e38 [file] [log] [blame]
Shih-wei Liaoea285162010-06-04 12:34:56 -07001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3template<typename T>
4struct add_pointer {
5 typedef T* type; // expected-error{{'type' declared as a pointer to a reference}}
6};
7
8add_pointer<int>::type test1(int * ptr) { return ptr; }
9
10add_pointer<float>::type test2(int * ptr) {
11 return ptr; // expected-error{{cannot initialize return object of type 'add_pointer<float>::type' (aka 'float *') with an lvalue of type 'int *'}}
12}
13
14add_pointer<int&>::type // expected-note{{in instantiation of template class 'add_pointer<int &>' requested here}}
15test3();