summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/duplicate-reports.cpp
blob: c825c2ca243d33c5497e4e47ca1c73630dee62a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: %check_clang_tidy %s cert-err09-cpp,cert-err61-cpp %t

void alwaysThrows() {
  int ex = 42;
  // CHECK-MESSAGES: warning: throw expression should throw anonymous temporary values instead [cert-err09-cpp]
  // CHECK-MESSAGES: warning: throw expression should throw anonymous temporary values instead [cert-err61-cpp]
  throw ex;
}

void doTheJob() {
  try {
    alwaysThrows();
  } catch (int&) {
  }
}
OpenPOWER on IntegriCloud