[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaTemplate / instantiate-typedef.cpp
blob4e6cd24111c47a727aa9a33c7f23b75ebc465e38
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 template<typename T>
4 struct add_pointer {
5 typedef T* type; // expected-error{{'type' declared as a pointer to a reference}}
6 };
8 add_pointer<int>::type test1(int * ptr) { return ptr; }
10 add_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 *'}}
14 add_pointer<int&>::type // expected-note{{in instantiation of template class 'add_pointer<int &>' requested here}}
15 test3();