================ @@ -956,42 +956,72 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } -const Expr * +namespace { + +struct MemberExprBaseVisitor + : public StmtVisitor<MemberExprBaseVisitor, Expr *> { + MemberExprBaseVisitor() = default; + + //===--------------------------------------------------------------------===// + // Visitor Methods + //===--------------------------------------------------------------------===// + + Expr *Visit(Expr *E) { + return StmtVisitor<MemberExprBaseVisitor, Expr *>::Visit(E); + } + + Expr *VisitArraySubscriptExpr(ArraySubscriptExpr *E) { + return Visit(E->getBase()); + } + Expr *VisitCastExpr(CastExpr *E) { return Visit(E->getSubExpr()); } + Expr *VisitDeclRefExpr(DeclRefExpr *E) { return E; } + Expr *VisitMemberExpr(MemberExpr *E) { return Visit(E->getBase()); } + Expr *VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); } + Expr *VisitUnaryOperator(UnaryOperator *E) { return Visit(E->getSubExpr()); } ---------------- bwendling wrote:
<response voice="Bjarne">You should obviously use a `std::vector!`</response> ;-) Ooohhh....my head. Okay. Hmm... Technically, flexible array members aren't valid in C++. So could we just smack any developer who tries to do this? ... Please? ;-) I'll add a check for something like this. https://github.com/llvm/llvm-project/pull/73730 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits