Skip to content

Commit

Permalink
[clang][CodeGen] Fix gcc warning about unused variable [NFC]
Browse files Browse the repository at this point in the history
Without the fix gcc warned with
 ../../clang/lib/CodeGen/CGBuiltin.cpp:1022:19: warning: unused variable 'DRE' [-Wunused-variable]
  1022 |   if (const auto *DRE = dyn_cast<DeclRefExpr>(Base)) {
       |                   ^~~

Fix the warning by removing the unused variable and change the "dyn_cast"
to "isa".
  • Loading branch information
mikaelholmen committed Jan 17, 2024
1 parent e3702f6 commit e6bd983
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type,
FAMSize = Builder.CreateIntCast(FAMSize, ResType, IsSigned);
Value *Res = FAMSize;

if (const auto *DRE = dyn_cast<DeclRefExpr>(Base)) {
if (isa<DeclRefExpr>(Base)) {
// The whole struct is specificed in the __bdos.
const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(OuterRD);

Expand Down

0 comments on commit e6bd983

Please sign in to comment.