[PATCH] D128202: [clangd] Include "final" when printing class declaration
Tom Praschan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 20 07:17:24 PDT 2022
tom-anders added inline comments.
================
Comment at: clang/lib/AST/DeclPrinter.cpp:1010
+ if (D->isEffectivelyFinal()) {
+ Out << " final";
----------------
sammccall wrote:
> isEffectivelyFinal returns true for
> `struct X { ~X() final; }`
>
> I don't think we want to print `struct X final {}` in that case.
>
> Probably want to replicate the check for FinalAttr instead?
Agreed. Would probably make sense to add a `bool hasFinalAttribute() const` to `CXXRecordDecl`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128202/new/
https://reviews.llvm.org/D128202
More information about the cfe-commits
mailing list