diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-16 00:24:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-16 00:24:44 +0000 |
commit | 0c9e4799fd78d350a037498b2c797f2b2558791c (patch) | |
tree | 722af636b2c6d2c8bd639a4354ca5fe494822308 /lib/Sema/SemaDecl.cpp | |
parent | 399ad970a25efcbfa7111e17f48285a70fba2731 (diff) |
Check for unexpanded parameter packs in enumeration types and enumerators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 5704cb5ad4..95c3b99801 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -5771,6 +5771,11 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, // Recover by falling back to int. EnumUnderlying = Context.IntTy.getTypePtr(); } + + if (DiagnoseUnexpandedParameterPack(UnderlyingLoc, TI, + UPPC_FixedUnderlyingType)) + EnumUnderlying = Context.IntTy.getTypePtr(); + } else if (getLangOptions().Microsoft) // Microsoft enums are always of int type. EnumUnderlying = Context.IntTy.getTypePtr(); @@ -7319,6 +7324,10 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, unsigned IntWidth = Context.Target.getIntWidth(); llvm::APSInt EnumVal(IntWidth); QualType EltTy; + + if (Val && DiagnoseUnexpandedParameterPack(Val, UPPC_EnumeratorValue)) + Val = 0; + if (Val) { if (Enum->isDependentType() || Val->isTypeDependent()) EltTy = Context.DependentTy; |