[PATCH] D112707: [clangd] IncludeCleaner: Be more conservative in marking RecordDecl usage

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 2 06:04:14 PST 2021


sammccall added a comment.

In D112707#3166535 <https://reviews.llvm.org/D112707#3166535>, @kbobyrev wrote:

> @sammccall
>
> There is one part of your comment that I couldn't understand, could you please clarify what you mean bi this?
>
>> we can't skip based on a definition (main file or class) that can't stand alone, usually because of qualifiers. e.g. void foo::bar() {}.
>
> FWIW if we decided to only deal with `RecordDecl` I don't know if your comment refers to them or it's some other context. An example for what you mean would be appreciated!

Yeah I don't think this applies to classes.
The following is valid but you can't drop the (include of) first declaration:

  namespace a { void foo(); }
  void a::foo();

However classes cannot be forward-declared with qualifiers in this way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112707



More information about the cfe-commits mailing list