Check for unexpanded parameter packs in enumeration types and enumerators.

llvm-svn: 121928
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 5704cb5..95c3b99 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5771,6 +5771,11 @@
         // 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 @@
   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;