mirror of
https://github.com/opnsense/src.git
synced 2026-02-20 16:30:53 -05:00
16 lines
637 B
C++
16 lines
637 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
template<typename T>
|
|
struct add_pointer {
|
|
typedef T* type; // expected-error{{'type' declared as a pointer to a reference}}
|
|
};
|
|
|
|
add_pointer<int>::type test1(int * ptr) { return ptr; }
|
|
|
|
add_pointer<float>::type test2(int * ptr) {
|
|
return ptr; // expected-error{{cannot initialize return object of type 'add_pointer<float>::type' (aka 'float *') with an lvalue of type 'int *'}}
|
|
}
|
|
|
|
add_pointer<int&>::type // expected-note{{in instantiation of template class 'struct add_pointer<int &>' requested here}} \
|
|
// expected-error {{no type named 'type' in 'struct add_pointer<int &>'}}
|
|
test3();
|