diff options
Diffstat (limited to 'clang/test/SemaCXX/warn_false_to_pointer.cpp')
-rw-r--r-- | clang/test/SemaCXX/warn_false_to_pointer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn_false_to_pointer.cpp b/clang/test/SemaCXX/warn_false_to_pointer.cpp new file mode 100644 index 00000000000..3a873d886f0 --- /dev/null +++ b/clang/test/SemaCXX/warn_false_to_pointer.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +int* j = false; // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}} + +void foo(int* i, int *j=(false)) // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}} +{ + foo(false); // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}} +} + |