[PATCH] D57100: [clang-tidy] refactor bugprone-exception-escape analysis into class
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 30 08:32:54 PST 2019
lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.
Looked this over once more. To me this looks pretty straight-forward.
The caching seems ok, too. As long as `ExceptionAnalyzer` does not outlive
it's `TU`, everything should be fine.
@baloghadamsoftware - thoughts?
================
Comment at: clang-tidy/bugprone/ExceptionEscapeCheck.cpp:73-81
+ if (Tracer.throwsException(MatchedDecl))
+ // FIXME: We should provide more information about the exact location where
+ // the exception is thrown, maybe the full path the exception escapes
+ diag(MatchedDecl->getLocation(),
+ "an exception may be thrown in function %0 "
+
+ "which should not throw exceptions")
----------------
I think you could do early-exit.
Also, if you de-split the string, clang-format might produce better formatting.
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57100/new/
https://reviews.llvm.org/D57100
More information about the cfe-commits
mailing list