[clang] Suppress "follow-up" diagnostics on recovery call expressions.
Because of typo-correction, the AST can be transformed, and the transformed AST is marginally useful for diagnostics purpose, the following diagnostics usually do harm than good (easily cause confusions). Given the following code: ``` void abcc(); void test() { if (abc()); // diagnostic 1 (for the typo-correction): the typo is correct to `abcc()`, so the code is treate as `if (abcc())` in AST perspective; // diagnostic 2 (for mismatch type): we perform an type-analysis on `if`, discover the type is not match } ``` The secondary diagnostic "convertable to bool" is likely bogus to users. The idea is to use RecoveryExpr (clang's dependent mechanism) to preserve the recovery behavior but suppress all follow-up diagnostics. Differential Revision: https://reviews.llvm.org/D89946
Loading
Please sign in to comment