[PATCH] D136533: Fix missing diagnostic of declaration use when accessing TypeDecls through typename access

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 23 13:15:13 PDT 2022


mizvekov added a comment.

In D136533#3877854 <https://reviews.llvm.org/D136533#3877854>, @ychen wrote:

> Looks straightforward to me with one suggestion.
>
> Is the CI fail related?

Yeah, the CI fail is because, while there is a change in libcxx diagnostics and we fix it, the same tests are run in different pipelines using stock, released clangs.

So we need a way to handle the difference in expectations. I have pinged libcxx devs about that.



================
Comment at: clang/include/clang/Sema/Sema.h:2569
 
+  enum class TypeAccessKind { Explicit, Implicit, Typename };
+  QualType getTypeDeclType(DeclContext *LookupCtx, TypeAccessKind AK,
----------------
ychen wrote:
> I find it hard to understand this enum since it does not correlate with wordings well and need to read code in other places to understand what it is used for. How about using two parameters: `bool DiagCtor` (replace `AK != TypeAccessKind::Explicit`) and `bool IsImplicitTypename` (replace `AK == TypeAccessKind::Typename`) ? 
Hmm, enums are more en vogue :)

How about we:
* Rename `TypeAccessKind` -> `DiagCtorKind`
* Rename `Explicit` -> `None`

?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136533



More information about the cfe-commits mailing list