We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c4fec8 commit e9e2378Copy full SHA for e9e2378
lib/Sema/MiscDiagnostics.cpp
@@ -2019,9 +2019,11 @@ class VarDeclUsageChecker : public ASTWalker {
2019
GuardStmt *GS = dyn_cast<GuardStmt>(S);
2020
if (!GS) continue;
2021
for (StmtConditionElement SCE : GS->getCond()) {
2022
- SCE.getPattern()->forEachVariable([&](VarDecl *VD) {
2023
- VarDecls[VD] = RK_Read|RK_Written;
2024
- });
+ if (auto pattern = SCE.getPatternOrNull()) {
+ pattern->forEachVariable([&](VarDecl *VD) {
+ VarDecls[VD] = RK_Read|RK_Written;
2025
+ });
2026
+ }
2027
}
2028
2029
0 commit comments