Skip to content

Instantly share code, notes, and snippets.

@robertdfrench
Created January 1, 2020 19:41
Show Gist options
  • Save robertdfrench/508288c9265207f0a343459992a90db2 to your computer and use it in GitHub Desktop.
Save robertdfrench/508288c9265207f0a343459992a90db2 to your computer and use it in GitHub Desktop.
C++ Exceptions vs clang-tidy bugprone-exception-escape
#include <stdexcept>
void f() {
throw exception();
}
class C {
C() {
throw exception();
}
}
int main() {
f(); // clang-tidy will fuss about this, because it's a function
C c; // but not this, because it's a statement
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment