[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 8 05:58:43 PDT 2023


Hahnfeld added a comment.

In D134813#4482808 <https://reviews.llvm.org/D134813#4482808>, @aaron.ballman wrote:

> In D134813#4482674 <https://reviews.llvm.org/D134813#4482674>, @Hahnfeld wrote:
>
>> Out of curiosity, not sure if it's worth fixing because it's easy enough to work around: I think after this change, it's not possible anymore to call `printName(raw_ostream &OS)` on a (statically typed) `TagDecl` / `EnumDecl` because it's hidden by `TagDecl::printName(raw_ostream &OS, const PrintingPolicy &Policy)` while it works perfectly for a `NamedDecl`. Is this intentional?
>
> That's not intentional, thank you for pointing it out! This should be corrected in 0566791ab28b5b842c3befea63d7d47fe9ba1a59 <https://reviews.llvm.org/rG0566791ab28b5b842c3befea63d7d47fe9ba1a59>

Thanks! Note that the same probably holds true (but I didn't test) for all other classes that override `printName(raw_ostream &OS, const PrintingPolicy &Policy)`, ie `DecompositionDecl`, `MSGuidDecl`, `UnnamedGlobalConstantDecl`, and `TemplateParamObjectDecl`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134813/new/

https://reviews.llvm.org/D134813



More information about the cfe-commits mailing list