balazske added inline comments.

================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/bugprone-unhandled-exception-at-new.cpp:143
+  f_est_noexcept_dependent_used<true>();
+}
----------------
aaron.ballman wrote:
> You have tests for placement new with `nothrow_t`, but I think other forms of 
> placement new are also very interesting to test as those typically don't 
> throw.
> 
> Additionally, perhaps tests where the allocation functions have been replaced 
> by the user (such as a class allocation function)?
I realized that the case of user-defined constructor or allocation function 
allows to throw any kind of exception. So the check should be improved to 
handle this case: Not rely on the syntax of new expression, instead check if 
the called allocation function or the called constructor may throw, and if yes, 
check what exceptions are possible. What is your opinion, is it a better 
approach?
(And a function to collect all possible exceptions called from a function is 
needed, `ExceptionAnalyzer` seems usable.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97196/new/

https://reviews.llvm.org/D97196

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to