kimgr wrote:

> If the intent is to produce a forward declaration the final keyword cannot be 
> attached to a forward declaration. So I am not sure what's the "right" fix 
> here...

I don't believe that's the intent of `DeclPrinter` or `PolishForDeclaration` --

* Clangd uses `PolishForDeclaration` to print an informational "hover text" for 
the declaration (and I guess that's why they want to include `final` -- it's 
something that's good for an interactive user to know about the decl)
* IWYU uses `PolishForDeclaration` to get a valid _declaration_, and then does 
[some very hacky heuristic 
post-processing](https://github.com/include-what-you-use/include-what-you-use/blob/125341c412ceee9233ece8973848b49e770a9b82/iwyu_output.cc#L469)
 to turn it into a forward-decl.

Sorry for stirring confusion into this, my primary focus is IWYU, but I 
remember that the original double-final came from a change intended for Clangd.

Hopefully this helps clarify.

https://github.com/llvm/llvm-project/pull/88600
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to