[PATCH] D149612: [Sema] avoid merge error type

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 11:32:40 PDT 2023


erichkeane requested changes to this revision.
erichkeane added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Sema/SemaType.cpp:2583
+    if (ArraySize->containsErrors()) {
+      RecoveryExpr *RE = RecoveryExpr::Create(
+          Context, ArraySize->getType(), ArraySize->getBeginLoc(),
----------------
Actually thinking further... rather than create a NEW RecoveryExpr, is there a problem KEEPING the ArraySize expression?  It'd likely give more information/keep more AST consistency.

ALSO, creating this as size-0 has some implications we probably don't want.  I wonder if a different for the placeholder would be better?  

I'D ALSO suggest hoisting this ArraySize->containsError out of the else-if and into its own branch (rather than inside the dependent checks).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149612



More information about the cfe-commits mailing list