[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / SemaCXX / nonnull.cpp
blob97b54553427d93d3c6a3d1dfff61b1131dfa9753
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 template<int I>
4 struct TS {
5 __attribute__((returns_nonnull))
6 void *value_dependent(void) {
7 return I; // no-warning
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}}
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); }