================
@@ -21087,6 +21086,26 @@ static ICEDiag CheckICE(const Expr* E, const
ASTContext &Ctx) {
case Expr::HLSLOutArgExprClass:
return ICEDiag(IK_NotICE, E->getBeginLoc());
+ case Expr::MemberExprClass: {
+ if (Ctx.getLangOpts().C23) {
+ const Expr *ME = E->IgnoreParenImpCasts();
+ while (const auto *M = dyn_cast<MemberExpr>(ME)) {
+ if (M->isArrow())
+ return ICEDiag(IK_NotICE, E->getBeginLoc());
+ ME = M->getBase()->IgnoreParenImpCasts();
+ }
+ const auto *DRE = dyn_cast<DeclRefExpr>(ME);
+ if (DRE) {
+ const auto *VD = dyn_cast<VarDecl>(DRE->getDecl());
+ if (VD && VD->isConstexpr())
----------------
Fznamznon wrote:
A nit
```suggestion
if (const auto *VD = dyn_cast<VarDecl>(DRE->getDecl()); VD &&
VD->isConstexpr())
```
https://github.com/llvm/llvm-project/pull/182770
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits