You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
543 B

// RUN: %clang_cc1 -verify %s
#define NODEREF __attribute__((noderef))
template <typename T>
int func(T NODEREF *a) { // expected-note 2 {{a declared here}}
return *a + 1; // expected-warning 2 {{dereferencing a; was declared with a 'noderef' type}}
}
void func() {
float NODEREF *f;
int NODEREF *i;
func(f); // expected-note{{in instantiation of function template specialization 'func<float>' requested here}}
func(i); // expected-note{{in instantiation of function template specialization 'func<int>' requested here}}
}