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

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 24 12:50:35 PDT 2022


ychen added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:2569
 
+  enum class TypeAccessKind { Explicit, Implicit, Typename };
+  QualType getTypeDeclType(DeclContext *LookupCtx, TypeAccessKind AK,
----------------
mizvekov wrote:
> 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`
> 
> ?
Yep. That works for me. Thanks.


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