xref: /llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-reports.cpp (revision 885c559369fe3d6323898c17787bd0454065fc34)
1 // RUN: %check_clang_tidy %s cert-err09-cpp,cert-err61-cpp %t -- -- -fexceptions
2 
3 void alwaysThrows() {
4   int ex = 42;
5   // CHECK-MESSAGES: warning: throw expression should throw anonymous temporary values instead [cert-err09-cpp]
6   // CHECK-MESSAGES: warning: throw expression should throw anonymous temporary values instead [cert-err61-cpp]
7   throw ex;
8 }
9 
10 void doTheJob() {
11   try {
12     alwaysThrows();
13   } catch (int&) {
14   }
15 }
16