[PATCH] D126093: Sema: adjust assertion to account for deduced types

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 04:20:37 PDT 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.

LGTM aside from a testing request and a nit. Thanks for the fix!



================
Comment at: clang/include/clang/Sema/DeclSpec.h:520
+    assert(isDeclRep((TST)TypeSpecType) || isTypeRep((TST)TypeSpecType) ||
+           isExprRep((TST)TypeSpecType));
     return TSTNameLoc;
----------------
I think you've got a test case covering `isExprRep()` because your `__typeof__` names an expression, but can you also add coverage for `isTypeRep()` where `__typeof__` names a type instead, as in: https://godbolt.org/z/hfK8ds9EM


================
Comment at: clang/test/Sema/typerep-typespec.c:1
+// RUN: %clang_cc1 -std=c11 -x c %s -fsyntax-only -verify
+// REQUIRES: asserts
----------------



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

https://reviews.llvm.org/D126093



More information about the cfe-commits mailing list