diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-23 23:55:39 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-23 23:55:39 +0000 |
| commit | 5614ca77153b254f9ab756d4a41c4a55ed9dda46 (patch) | |
| tree | e0d9180eac3c671ae5723fd7a546b8f3af731597 /clang/test/SemaCXX/constexpr-printing.cpp | |
| parent | d18cb502bdfcf76ea0f5b45014ccf7df030a7829 (diff) | |
| download | bcm5719-llvm-5614ca77153b254f9ab756d4a41c4a55ed9dda46.tar.gz bcm5719-llvm-5614ca77153b254f9ab756d4a41c4a55ed9dda46.zip | |
Teach APValue printer to print boolean 0 and 1 as 'false' and 'true'. Fix up
some calling code to actually pass in a non-null type, to avoid a crash.
llvm-svn: 153358
Diffstat (limited to 'clang/test/SemaCXX/constexpr-printing.cpp')
| -rw-r--r-- | clang/test/SemaCXX/constexpr-printing.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/constexpr-printing.cpp b/clang/test/SemaCXX/constexpr-printing.cpp index 2e0eb9c23d1..4e5bc429dbd 100644 --- a/clang/test/SemaCXX/constexpr-printing.cpp +++ b/clang/test/SemaCXX/constexpr-printing.cpp @@ -96,3 +96,7 @@ void LabelDiffTest() { static_assert(mulBy3((LabelDiffTy)&&a-(LabelDiffTy)&&b) == 3, ""); // expected-error {{constant expression}} expected-note {{call to 'mulBy3(&&a - &&b)'}} a:b:return; } + +constexpr bool test_bool_printing(bool b) { return 1 / !(2*b | !(2*b)); } // expected-note 2{{division by zero}} +constexpr bool test_bool_0 = test_bool_printing(false); // expected-error {{constant expr}} expected-note {{in call to 'test_bool_printing(false)'}} +constexpr bool test_bool_1 = test_bool_printing(true); // expected-error {{constant expr}} expected-note {{in call to 'test_bool_printing(true)'}} |

