Skip to content

Commit 387e0d6

Browse files
authored
ASTVerifier: make sure isFinal and FinalAttr are in sync (#26740)
Serialization is currently working around them /not/ having been in sync in the past, but they are now, and we might as well start depending on it.
1 parent c6d5c84 commit 387e0d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/AST/ASTVerifier.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,14 @@ class Verifier : public ASTWalker {
23622362
}
23632363
}
23642364

2365+
if (VD->isFinal() != VD->getAttrs().hasAttribute<FinalAttr>()) {
2366+
Out << "decl should be final iff it has FinalAttr, but isFinal() = "
2367+
<< VD->isFinal() << " and hasAttribute<FinalAttr>() = "
2368+
<< VD->getAttrs().hasAttribute<FinalAttr>() << "\n";
2369+
VD->dump(Out);
2370+
abort();
2371+
}
2372+
23652373
verifyCheckedBase(VD);
23662374
}
23672375

0 commit comments

Comments
 (0)