1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 3 template<int I> 4 struct TS { 5 __attribute__((returns_nonnull)) 6 void *value_dependent(void) { 7 return I; // no-warning 8 } 9 10 __attribute__((returns_nonnull)) 11 void *value_independent(void) { 12 return 0; // expected-warning {{null returned from function that requires a non-null return value}} 13 } 14 }; 15 16 namespace Template { 17 template<typename T> __attribute__((nonnull)) void f(T t); 18 void g() { f((void*)0); } // expected-warning {{null passed to a callee that requires a non-null argument}} 19 void h() { f(0); } 20 } 21