mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 12:15:46 +00:00
Make sure we perform lvalue-to-rvalue conversions for enum initializers. PR11484.
llvm-svn: 145874
This commit is contained in:
parent
18e2fe47fa
commit
7c6515a653
@ -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;
|
||||
|
@ -142,3 +142,8 @@ namespace test6 {
|
||||
(void) A::e; // expected-error {{incomplete type 'test6::A' named in nested name specifier}}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PR11484 {
|
||||
const int val = 104;
|
||||
enum class test1 { owner_dead = val, };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user