2018-12-06 01:05:54 +00:00
|
|
|
// RUN: %clang_cc1 -verify %s
|
|
|
|
|
|
|
|
#define NODEREF __attribute__((noderef))
|
|
|
|
|
|
|
|
template <typename T>
|
2024-05-15 21:52:59 -04:00
|
|
|
int func(T NODEREF *a) { // expected-note 3 {{a declared here}}
|
|
|
|
return *a + 1; // expected-warning 3 {{dereferencing a; was declared with a 'noderef' type}}
|
2018-12-06 01:05:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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}}
|
|
|
|
}
|