void catchTypedef() {
  try {
    testThrowFunc();
  } catch (logic_ptr) {
    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: catch handler catches a pointer value; should throw a non-pointer value and catch by reference instead [misc-throw-by-value-catch-by-reference]
  }
}
void catchByValue() {
  try {
    testThrowFunc();
  } catch (logic_error e) {
    // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: catch handler catches by value; should catch by reference instead [misc-throw-by-value-catch-by-reference]
  }
}
// catching fundamentals should not warn
void catchFundamental() {
  try {
    testThrowFunc();
  } catch (int) {
  } catch (double) {
  } catch (unsigned long) {
  }
}
void catchLiteral() {
  try {
    testThrowFunc();
  } catch (const char *) {
  } catch (const wchar_t *) {
    // disabled for now until it is clear
    // how to enable them in the test
    //} catch (const char16_t*) {
    //} catch (const char32_t*) {
  }
}
void catchAll() {
  try {
    testThrowFunc();
  } catch (...) {
  }
}
void catchByConstReference() {
  try {
    testThrowFunc();
  } catch (const logic_error &e) {
  }
}
void catchByReference() {
  try {
    testThrowFunc();
  } catch (logic_error &e) {
  }
}
void catchTrivial() {
  try {
    testThrowFunc();
  } catch (TrivialType) {
  }
}