aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.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 /lib/Sema/SemaOverload.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 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 4d8795ea96..14f8db6db5 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -4818,6 +4818,12 @@ static bool CheckConvertedConstantConversions(Sema &S,
return true;
case ICK_Boolean_Conversion:
+ // Conversion from an integral or unscoped enumeration type to bool is
+ // classified as ICK_Boolean_Conversion, but it's also an integral
+ // conversion, so it's permitted in a converted constant expression.
+ return SCS.getFromType()->isIntegralOrUnscopedEnumerationType() &&
+ SCS.getToType(2)->isBooleanType();
+
case ICK_Floating_Integral:
case ICK_Complex_Real:
return false;