aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-08-01 14:09:06 +0200
committerGitHub <noreply@github.com>2025-08-01 14:09:06 +0200
commitd8ca85a184c0fb511fe6483c4c24e48b5b1eb07a (patch)
treefb3d6c7bcecb5461909a126031cf5b2a530f6651 /clang/lib/Sema/SemaDecl.cpp
parentf48a8da34292b367ba8a5e7b25065172df966848 (diff)
downloadllvm-d8ca85a184c0fb511fe6483c4c24e48b5b1eb07a.zip
llvm-d8ca85a184c0fb511fe6483c4c24e48b5b1eb07a.tar.gz
llvm-d8ca85a184c0fb511fe6483c4c24e48b5b1eb07a.tar.bz2
[clang][ExprConst] Remove Loc param (#151461)
The Loc param to these functions was weird and not always set in error cases. It wasn't reliable to use. This was almost entirely unused inside of clang and the one call site that used the returned source location doesn't make a difference in practice.
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
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();
}
}