aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/nonnull.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/nonnull.cpp')
-rw-r--r--test/SemaCXX/nonnull.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/SemaCXX/nonnull.cpp b/test/SemaCXX/nonnull.cpp
index 9ff6d115bd16..97b54553427d 100644
--- a/test/SemaCXX/nonnull.cpp
+++ b/test/SemaCXX/nonnull.cpp
@@ -13,3 +13,8 @@ struct TS {
}
};
+namespace Template {
+ template<typename T> __attribute__((nonnull)) void f(T t);
+ void g() { f((void*)0); } // expected-warning {{null passed to a callee that requires a non-null argument}}
+ void h() { f(0); }
+}