[PATCH] D48714: [clang-tidy] fix PR37913, templated exception factory diagnosed correctly

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 04:45:22 PDT 2018


hokein added inline comments.


================
Comment at: test/clang-tidy/hicpp-exception-baseclass.cpp:191
+void templated_thrower() { throw T{}(); }
+// CHECK-MESSAGES: [[@LINE-1]]:34: warning: throwing an exception whose type 'int' is not derived from 'std::exception'
+
----------------
I think giving message on the template function here is confusing to users even it gets instantiated somewhere in this TU -- because users have to find the location that triggers the template instantiation.

Maybe 
1) Add a note which gives the instantiation location to the message, or
2) ignore template case (some clang-tidy checks do this)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D48714





More information about the cfe-commits mailing list