brintos

brintos / llvm-project-archived public Read only

0
0
Text · 950 B · 48c9bac Raw
48 lines · cpp
1// RUN: %check_clang_tidy -std=c++11-or-later %s bugprone-exception-escape %t -- \2// RUN:     -config="{CheckOptions: { \3// RUN:         bugprone-exception-escape.CheckDestructors: false, \4// RUN:         bugprone-exception-escape.CheckMoveMemberFunctions: false, \5// RUN:         bugprone-exception-escape.CheckMain: false, \6// RUN:         bugprone-exception-escape.CheckedSwapFunctions: '', \7// RUN:         bugprone-exception-escape.CheckNothrowFunctions: false \8// RUN:     }}" \9// RUN:     -- -fexceptions10 11// CHECK-MESSAGES-NOT: warning:12 13struct destructor {14  ~destructor() {15    throw 1;16  }17};18 19struct move {20    move(move&&) { throw 42; }21    move& operator=(move&&) { throw 42; }22};23 24void swap(int&, int&) {25  throw 1;26}27 28void iter_swap(int&, int&) {29  throw 1;30}31 32void iter_move(int&) {33  throw 1;34}35 36void nothrow_func() throw() {37  throw 1;38}39 40void noexcept_func() noexcept {41  throw 1;42}43 44int main() {45  throw 1;46  return 0;47}48