summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp')
-rw-r--r--clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp b/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp
index d6a2169a5ba..c33bf0eba23 100644
--- a/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp
+++ b/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp
@@ -46,6 +46,11 @@ namespace ccce {
if constexpr (N) {} // expected-error {{cannot be narrowed}}
}
template void g<5>(); // expected-note {{instantiation of}}
+ void h() {
+ if constexpr (4.3) {} // expected-error{{conversion from 'double' to 'bool' is not allowed in a converted constant expression}}
+ constexpr void *p = nullptr;
+ if constexpr (p) {} // expected-error{{conversion from 'void *const' to 'bool' is not allowed in a converted constant expression}}
+ }
}
namespace generic_lambda {
OpenPOWER on IntegriCloud