Case values must be evaluated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59884 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 6839310..15d955c 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -131,8 +131,10 @@
   // However, GCC allows any evaluatable integer expression. 
   // FIXME: Should we warn if this is evaluatable but not an I-C-E?
   APValue Result;
+  bool isEvaluated;
   
-  if (!LHSVal->Evaluate(Result, Context) || !Result.isInt()) {
+  if (!LHSVal->Evaluate(Result, Context, &isEvaluated) || !Result.isInt() ||
+      !isEvaluated) {
     // FIXME: Evaluate doesn't return the SourceLocation that it failed to
     // evaluate. 
     ExpLoc = LHSVal->getExprLoc();
@@ -142,7 +144,8 @@
   }
 
   // GCC extension: The expression shall be an integer constant.
-  if (RHSVal && !RHSVal->Evaluate(Result, Context) || !Result.isInt()) {
+  if (RHSVal && !RHSVal->Evaluate(Result, Context, &isEvaluated) || 
+      !Result.isInt() || !isEvaluated) {
     ExpLoc = RHSVal->getExprLoc();
     Diag(ExpLoc, diag::err_case_label_not_integer_constant_expr)
       << RHSVal->getSourceRange();