Use VerifyIntegerConstantExpression instead of isIntegerConstantExpr. Fixes PR2963
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60591 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 4113075..4fd13c3 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2899,8 +2899,7 @@
// C99 6.7.2.2p2: Make sure we have an integer constant expression.
SourceLocation ExpLoc;
- if (!Val->isIntegerConstantExpr(EnumVal, Context, &ExpLoc)) {
- Diag(ExpLoc, diag::err_enum_value_not_integer_constant_expr) << Id;
+ if (VerifyIntegerConstantExpression(Val, &EnumVal)) {
delete Val;
Val = 0; // Just forget about it.
} else {