Created
January 1, 2020 19:41
-
-
Save robertdfrench/508288c9265207f0a343459992a90db2 to your computer and use it in GitHub Desktop.
C++ Exceptions vs clang-tidy bugprone-exception-escape
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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