aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-12-06 00:10:34 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-12-06 00:10:34 +0000
commit19efa3ee5a7f2232884f9cca6871329ffe85653c (patch)
tree8d5d743216f9d667f7d821059c557748ed1b2ae3 /lib/Sema/SemaDecl.cpp
parentec236787c5868eef53a807ca1a68b6b0b8c604c6 (diff)
Make sure we perform lvalue-to-rvalue conversions for enum initializers. PR11484.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index fdb2cf5d96..c90b7492a2 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -9449,6 +9449,9 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum,
if (Val && DiagnoseUnexpandedParameterPack(Val, UPPC_EnumeratorValue))
Val = 0;
+ if (Val)
+ Val = DefaultLvalueConversion(Val).take();
+
if (Val) {
if (Enum->isDependentType() || Val->isTypeDependent())
EltTy = Context.DependentTy;