summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-16 00:24:44 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-16 00:24:44 +0000
commit2b988fd7451bd59e9598c84f5bbc9425c45e28c0 (patch)
tree6f1b449854777009dc41f1d8de500b86095fdda3 /clang/lib
parentc7a2c053ff4175ce99f7686706baade829fbe6fd (diff)
downloadbcm5719-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.cpp9
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;
OpenPOWER on IntegriCloud