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