2019-08-25 01:19:06 +08:00
|
|
|
// RUN: %check_clang_tidy %s cert-err09-cpp,cert-err61-cpp %t -- -- -fexceptions
|
[clang-tidy] Possibility of displaying duplicate warnings
Summary: In case a checker is registered multiple times as an alias, the emitted warnings are uniqued by the report message. However, it is random which checker name is included in the warning. When processing the output of clang-tidy this behavior caused some problems. In this commit the uniquing key contains the checker name too.
Reviewers: alexfh, xazax.hun, Szelethus, aaron.ballman, lebedev.ri, JonasToth, gribozavr
Reviewed By: alexfh
Subscribers: dkrupp, whisperity, rnkovacs, mgrang, cfe-commits
Patch by Tibor Brunner!
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65065
llvm-svn: 369763
2019-08-23 22:57:27 +08:00
|
|
|
|
|
|
|
void alwaysThrows() {
|
|
|
|
int ex = 42;
|
2020-06-20 03:40:03 +08:00
|
|
|
// CHECK-MESSAGES: warning: throw expression should throw anonymous temporary values instead [cert-err09-cpp,cert-err61-cpp]
|
[clang-tidy] Possibility of displaying duplicate warnings
Summary: In case a checker is registered multiple times as an alias, the emitted warnings are uniqued by the report message. However, it is random which checker name is included in the warning. When processing the output of clang-tidy this behavior caused some problems. In this commit the uniquing key contains the checker name too.
Reviewers: alexfh, xazax.hun, Szelethus, aaron.ballman, lebedev.ri, JonasToth, gribozavr
Reviewed By: alexfh
Subscribers: dkrupp, whisperity, rnkovacs, mgrang, cfe-commits
Patch by Tibor Brunner!
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65065
llvm-svn: 369763
2019-08-23 22:57:27 +08:00
|
|
|
throw ex;
|
|
|
|
}
|
|
|
|
|
|
|
|
void doTheJob() {
|
|
|
|
try {
|
|
|
|
alwaysThrows();
|
|
|
|
} catch (int&) {
|
|
|
|
}
|
|
|
|
}
|