aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.const/p3-0x.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-09-13 22:00:12 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-09-13 22:00:12 +0000
commit2bcb984df975c75130f2320c935fae1143c2a5cc (patch)
tree70b18535704a74758b7562bb17aa484af2bc8389 /test/CXX/expr/expr.const/p3-0x.cpp
parent71074fdf40a8f5b53810712102b58c27efc30759 (diff)
Revert r163829. The world (or libstdc++, at least) is not ready.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.const/p3-0x.cpp')
-rw-r--r--test/CXX/expr/expr.const/p3-0x.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/CXX/expr/expr.const/p3-0x.cpp b/test/CXX/expr/expr.const/p3-0x.cpp
index dca20c90c2..6ddd11bcee 100644
--- a/test/CXX/expr/expr.const/p3-0x.cpp
+++ b/test/CXX/expr/expr.const/p3-0x.cpp
@@ -73,13 +73,12 @@ 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
-// boolean conversions, not integral conversions, so are not permitted. See
-// core issue 1407.
+// integral conversions as well as boolean conversions.
template<typename T, T v> struct Val { static constexpr T value = v; };
-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}}
+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'}}
// (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}}