diff options
author | Haojian Wu <hokein.wu@gmail.com> | 2020-10-26 12:40:00 +0100 |
---|---|---|
committer | Haojian Wu <hokein.wu@gmail.com> | 2020-10-26 12:40:00 +0100 |
commit | efa9aaad703e6b150980ed1a74b4e7c9da7d85a2 (patch) | |
tree | 303189cdd1cd86426b42ab4f117825c85f93fe18 /llvm/lib/Object/ArchiveWriter.cpp | |
parent | 6b2eb31e1e2db1f3ca7a5c4914ab08cb18698de7 (diff) | |
download | llvm-efa9aaad703e6b150980ed1a74b4e7c9da7d85a2.zip llvm-efa9aaad703e6b150980ed1a74b4e7c9da7d85a2.tar.gz llvm-efa9aaad703e6b150980ed1a74b4e7c9da7d85a2.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Object/ArchiveWriter.cpp')
0 files changed, 0 insertions, 0 deletions