[Sema] Preserve invalid CXXCtorInitializers using RecoveryExpr in initializer
Before this patch, CXXCtorInitializers that don't typecheck get discarded in most cases. In particular: - typos that can't be corrected don't turn into RecoveryExpr. The full expr disappears instead, and without an init expr we discard the node. - initializers that fail initialization (e.g. constructor overload resolution) are discarded too. This patch addresses both these issues (a bit clunkily and repetitively, for member/base/delegating initializers) It does not preserve any AST nodes when the member/base can't be resolved or other problems of that nature. That breaks invariants of CXXCtorInitializer itself, and we don't have a "weak" RecoveryCtorInitializer like we do for Expr. I believe the changes to diagnostics in existing tests are improvements. (We're able to do some analysis on the non-broken parts of the initializer) Differential Revision: https://reviews.llvm.org/D101641
Loading
Please register or sign in to comment