================
@@ -2294,8 +2292,11 @@ void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) {
if (const auto *RD = dyn_cast<RecordDecl>(D))
DiagnoseUnusedNestedTypedefs(RD, addDiag);
if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
- DiagnoseUnusedButSetDecl(VD, addDiag);
- RefsMinusAssignments.erase(VD);
+ // Wait until end of TU to diagnose internal linkage file vars.
+ if (!VD->isInternalLinkageFileVar()) {
----------------
zwuis wrote:
```cpp
if (auto *VD = ...;
VD && ...) {
```
To reduce indentation.
https://github.com/llvm/llvm-project/pull/178342
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits