diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-04-09 07:48:17 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-04-09 07:48:17 +0000 |
commit | b6006696358572a668d6de773af8f550e54259bf (patch) | |
tree | 9eca251c932e4c792055144e5cb0ab3783a0dbb9 /test/SemaCXX/warn_false_to_pointer.cpp | |
parent | 88f0aed95d2a0faf3cad66af2dc54596495a7d41 (diff) |
Clean up the bool conversion warning. Group it with other conversion
warnings, and make its text appropriate for constant bool expressions
other than 'false'. This should finish off PR9612.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn_false_to_pointer.cpp')
-rw-r--r-- | test/SemaCXX/warn_false_to_pointer.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/test/SemaCXX/warn_false_to_pointer.cpp b/test/SemaCXX/warn_false_to_pointer.cpp deleted file mode 100644 index 20d4b3a52d..0000000000 --- a/test/SemaCXX/warn_false_to_pointer.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// 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'}} - foo((int*)false); // no-warning: explicit cast - foo(0); // no-warning: not a bool, even though its convertible to bool - - foo(false == true); // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}} - foo((42 + 24) < 32); // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}} - - const bool kFlag = false; - foo(kFlag); // expected-warning{{ initialization of pointer of type 'int *' from literal 'false'}} -} - -char f(struct Undefined*); -double f(...); - -// Ensure that when using false in metaprogramming machinery its conversion -// isn't flagged. -template <int N> struct S {}; -S<sizeof(f(false))> s; |