brintos

brintos / llvm-project-archived public Read only

0
0
Text · 543 B · 9e54cd5 Raw
16 lines · cpp
1// RUN: %clang_cc1 -verify %s2 3#define NODEREF __attribute__((noderef))4 5template <typename T>6int func(T NODEREF *a) { // expected-note 3 {{a declared here}}7  return *a + 1;         // expected-warning 3 {{dereferencing a; was declared with a 'noderef' type}}8}9 10void func() {11  float NODEREF *f;12  int NODEREF *i;13  func(f); // expected-note{{in instantiation of function template specialization 'func<float>' requested here}}14  func(i); // expected-note{{in instantiation of function template specialization 'func<int>' requested here}}15}16