[PATCH] D131423: [clang] fix frontend crash when evaluating type trait

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 21:20:32 PDT 2022


shafik added inline comments.


================
Comment at: clang/lib/Basic/TypeTraits.cpp:64
+#define TYPE_TRAIT_N(Spelling, Name, Key) 0,
+#include "clang/Basic/TokenKinds.def"
+};
----------------
@aaron.ballman do we really have to include this three times? We are defining different macros so shouldn't we be able to include is just once? 

I see we do this in several other places but a few we don't.


================
Comment at: clang/lib/Parse/ParseExprCXX.cpp:3789
-
-  if (!Arity && Args.empty()) {
-    Diag(EndLoc, diag::err_type_trait_arity)
----------------
Why doesn't this catch our case but moving the check into `evaluateTypeTrait` does?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131423



More information about the cfe-commits mailing list