aaron.ballman added inline comments.
================
Comment at: clang-tidy/hicpp/ExceptionBaseclassCheck.cpp:41
+ "'std::exception'")
+ << BadThrow->getSubExpr()->getType() << BadThrow->getSourceRange();
----------------
Can you add a test that uses a rethrow? e.g.,
```
try {
throw 12; // Diagnose this
} catch (...) {
throw; // Does not diagnose this
}
```
================
Comment at: test/clang-tidy/hicpp-exception-baseclass.cpp:9
+class deep_hierarchy : public derived_exception {};
class non_derived_exception {};
----------------
Can you add a test that uses multiple inheritance? e.g.,
```
class terrible_idea : public non_derived_exception, public derived_exception {};
```
Also, is private inheritance also acceptable, or does it need to be public
inheritance? I kind of get the impression it needs to be public, because the
goal appears to be that you should always be able to catch a `std::exception`
instance, and you can't do that if it's privately inherited. That should have a
test as well.
https://reviews.llvm.org/D37060
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits