From f4c51d9d7613004222c3cc1a6944249a508a6399 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 4 Feb 2012 09:53:13 +0000 Subject: In C++11 mode, when an integral constant expression is desired and we have a value of class type, look for a unique conversion operator converting to integral or unscoped enumeration type and use that. Implements [expr.const]p5. Sema::VerifyIntegerConstantExpression now performs the conversion and returns the converted result. Some important callers of Expr::isIntegralConstantExpr have been switched over to using it (including all of those required for C++11 conformance); this switch brings a side-benefit of improved diagnostics and, in several cases, simpler code. However, some language extensions and attributes have not been moved across and will not perform implicit conversions on constant expressions of literal class type where an ICE is required. In passing, fix static_assert to perform a contextual conversion to bool on its argument. llvm-svn: 149776 --- clang/test/SemaCXX/enum-bitfield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test/SemaCXX/enum-bitfield.cpp') diff --git a/clang/test/SemaCXX/enum-bitfield.cpp b/clang/test/SemaCXX/enum-bitfield.cpp index 831b9825111..63445ca0583 100644 --- a/clang/test/SemaCXX/enum-bitfield.cpp +++ b/clang/test/SemaCXX/enum-bitfield.cpp @@ -14,5 +14,5 @@ struct X { struct Y { enum E : int(2); - enum E : Z(); // expected-error{{not an integral constant}} + enum E : Z(); // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'Z'}} }; -- cgit v1.2.3