diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-13 19:55:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-09-13 19:55:13 +0000 |
commit | b67ada6687e8e727a0171a339925ddd94093e3d0 (patch) | |
tree | aac595feded5da43a2706cec1f1a54c56a4941a9 /clang/test/CXX/expr/expr.const/p3-0x.cpp | |
parent | 5371c73cdfcc9bf9322119e2699e54afbe91d23c (diff) | |
download | bcm5719-llvm-b67ada6687e8e727a0171a339925ddd94093e3d0.tar.gz bcm5719-llvm-b67ada6687e8e727a0171a339925ddd94093e3d0.zip |
Remove speculative fix for C++ core issue 1407, since it was resolved as NAD.
llvm-svn: 163829
Diffstat (limited to 'clang/test/CXX/expr/expr.const/p3-0x.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.const/p3-0x.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/test/CXX/expr/expr.const/p3-0x.cpp b/clang/test/CXX/expr/expr.const/p3-0x.cpp index 6ddd11bcee2..dca20c90c2e 100644 --- a/clang/test/CXX/expr/expr.const/p3-0x.cpp +++ b/clang/test/CXX/expr/expr.const/p3-0x.cpp @@ -73,12 +73,13 @@ using Int = A<1000>; // expected-error {{template argument evaluates to 1000, wh using Int = A<-3>; // expected-error {{template argument evaluates to -3, which cannot be narrowed to type 'unsigned char'}} // Note, conversions from integral or unscoped enumeration types to bool are -// integral conversions as well as boolean conversions. +// boolean conversions, not integral conversions, so are not permitted. See +// core issue 1407. template<typename T, T v> struct Val { static constexpr T value = v; }; -static_assert(Val<bool, E1>::value == 1, ""); // ok -static_assert(Val<bool, '\0'>::value == 0, ""); // ok -static_assert(Val<bool, U'\1'>::value == 1, ""); // ok -static_assert(Val<bool, E5>::value == 1, ""); // expected-error {{5, which cannot be narrowed to type 'bool'}} +static_assert(Val<bool, E1>::value == 1, ""); // expected-error {{conversion from 'E' to 'bool' is not allowed in a converted constant expression}} +static_assert(Val<bool, '\0'>::value == 0, ""); // expected-error {{conversion from 'char' to 'bool' is not allowed in a converted constant expression}} +static_assert(Val<bool, U'\1'>::value == 1, ""); // expected-error {{conversion from 'char32_t' to 'bool' is not allowed in a converted constant expression}} +static_assert(Val<bool, E5>::value == 1, ""); // expected-error {{conversion from 'E' to 'bool' is not allowed in a converted constant expression}} // (no other conversions are permitted) using Int = A<1.0>; // expected-error {{conversion from 'double' to 'unsigned char' is not allowed in a converted constant expression}} |