Skip to content

Commit 4a32a41

Browse files
committed
[clang] Fix two gcc warnings about unused variables [NFC]
Without the fix gcc warns like ../../clang/lib/Sema/SemaDecl.cpp:2963:24: warning: unused variable 'SupA' [-Wunused-variable] 2963 | else if (const auto *SupA = dyn_cast<SuppressAttr>(Attr)) | ^~~~ and ../../clang/lib/Driver/Driver.cpp:4192:17: warning: unused variable 'IAA' [-Wunused-variable] 4192 | if (auto *IAA = dyn_cast<InstallAPIJobAction>(Current)) { | ^~~ Remove the unused variables and change the "dyn_cast"s into "isa"s.
1 parent cd55e23 commit 4a32a41

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4189,7 +4189,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
41894189
break;
41904190
}
41914191

4192-
if (auto *IAA = dyn_cast<InstallAPIJobAction>(Current)) {
4192+
if (isa<InstallAPIJobAction>(Current)) {
41934193
Current = nullptr;
41944194
break;
41954195
}

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2960,7 +2960,7 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
29602960
S.mergeHLSLNumThreadsAttr(D, *NT, NT->getX(), NT->getY(), NT->getZ());
29612961
else if (const auto *SA = dyn_cast<HLSLShaderAttr>(Attr))
29622962
NewAttr = S.mergeHLSLShaderAttr(D, *SA, SA->getType());
2963-
else if (const auto *SupA = dyn_cast<SuppressAttr>(Attr))
2963+
else if (isa<SuppressAttr>(Attr))
29642964
// Do nothing. Each redeclaration should be suppressed separately.
29652965
NewAttr = nullptr;
29662966
else if (Attr->shouldInheritEvenIfAlreadyPresent() || !DeclHasAttr(D, Attr))

0 commit comments

Comments
 (0)