[PATCH] D137825: [clang-include-cleaner] make SymbolLocation a real class, move FindHeaders

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 11 04:38:32 PST 2022


sammccall added a comment.

In D137825#3921273 <https://reviews.llvm.org/D137825#3921273>, @tschuett wrote:

> You could:
>
>   static_assert(std::variant_size_v<....> == 2);
>   
>   Kind kind() const { if (std::holds_alternative<SourceLocation>(Storage))  return Kind::Physical; return Kind::Standard; }
>
> and Kind could become `enum class Kind`. => You would get rid of the order on the variant and the `static_cast`.

Sure, but that's IMO less regular, harder to understand, and easier to get wrong when updating.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137825



More information about the cfe-commits mailing list