[clang] 7309e8c - Do not use the same identifier for a data member as a type; NFC
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 11 04:37:20 PDT 2022
Author: Aaron Ballman
Date: 2022-08-11T07:32:32-04:00
New Revision: 7309e8cfbe59844b4e0128c3f48eb1a68d8bad68
URL: https://github.com/llvm/llvm-project/commit/7309e8cfbe59844b4e0128c3f48eb1a68d8bad68
DIFF: https://github.com/llvm/llvm-project/commit/7309e8cfbe59844b4e0128c3f48eb1a68d8bad68.diff
LOG: Do not use the same identifier for a data member as a type; NFC
This should help address a build failure found after
09117b21890c652994f7ada0229d309b35b44259
../tools/clang/lib/Sema/SemaDeclCXX.cpp: In member function void clang::Sema::DiagnoseStaticAssertDetails(const clang::Expr*):
../tools/clang/lib/Sema/SemaDeclCXX.cpp:16666:19: error: declaration of const clang::Expr* clang::Sema::DiagnoseStaticAssertDetails(const clang::Expr*)::<unnamed struct>::Expr changes meaning of Expr [-fpermissive]
16666 | const Expr *Expr;
| ^~~~
In file included from ../tools/clang/include/clang/AST/DeclCXX.h:22,
from ../tools/clang/include/clang/AST/ASTLambda.h:18,
from ../tools/clang/lib/Sema/SemaDeclCXX.cpp:15:
../tools/clang/include/clang/AST/Expr.h:109:7: note: Expr declared here as class clang::Expr
109 | class Expr : public ValueStmt {
| ^~~~
Added:
Modified:
clang/lib/Sema/SemaDeclCXX.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 13eb9acb0e5e..ab3af1298be5 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -16663,14 +16663,14 @@ void Sema::DiagnoseStaticAssertDetails(const Expr *E) {
return;
struct {
- const clang::Expr *Expr;
+ const clang::Expr *Cond;
Expr::EvalResult Result;
SmallString<12> ValueString;
bool Print;
} DiagSide[2] = {{LHS, Expr::EvalResult(), {}, false},
{RHS, Expr::EvalResult(), {}, false}};
for (unsigned I = 0; I < 2; I++) {
- const Expr *Side = DiagSide[I].Expr;
+ const Expr *Side = DiagSide[I].Cond;
Side->EvaluateAsRValue(DiagSide[I].Result, Context, true);
More information about the cfe-commits
mailing list