[PATCH] D149612: [Sema] avoid merge error type
Congcong Cai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 8 15:40:55 PDT 2023
HerrCai0907 added inline comments.
================
Comment at: clang/lib/Sema/SemaType.cpp:2583
+ if (ArraySize->containsErrors()) {
+ RecoveryExpr *RE = RecoveryExpr::Create(
+ Context, ArraySize->getType(), ArraySize->getBeginLoc(),
----------------
erichkeane wrote:
> 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).
> KEEPING the ArraySize expression
Agree.
> creating this as size-0 has some implications we probably don't want.
Do you think we can modify it as 1? But I don't find a better way to identifier it as undef or other.
> hoisting this ArraySize->containsError out of the else-if
Done
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