diff options
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index d255c11..20fdf2d 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -14724,9 +14724,10 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { type->isIntegralOrEnumerationType()) { // In C++98, in-class initialization for a static data member must // be an integer constant expression. - SourceLocation Loc; - if (!Init->isIntegerConstantExpr(Context, &Loc)) { - Diag(Loc, diag::ext_in_class_initializer_non_constant) + // SourceLocation Loc; + if (!Init->isIntegerConstantExpr(Context)) { + Diag(Init->getExprLoc(), + diag::ext_in_class_initializer_non_constant) << Init->getSourceRange(); } } |