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 | 2b988fd7451bd59e9598c84f5bbc9425c45e28c0 (patch) | |
tree | 6f1b449854777009dc41f1d8de500b86095fdda3 /clang/lib | |
parent | c7a2c053ff4175ce99f7686706baade829fbe6fd (diff) | |
download | bcm5719-llvm-2b988fd7451bd59e9598c84f5bbc9425c45e28c0.tar.gz bcm5719-llvm-2b988fd7451bd59e9598c84f5bbc9425c45e28c0.zip |
Check for unexpanded parameter packs in enumeration types and enumerators.
llvm-svn: 121928
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5704cb5ad46..95c3b998019 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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; |