[PATCH] D33333: Emit warning when throw exception in destruct or dealloc functions which has a (possible implicit) noexcept specifier

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 18:49:35 PDT 2017


jyu2 updated this revision to Diff 99517.
jyu2 added a comment.

Reid,
Thank you so much for your comments.  I upload new patch to address your suggestion.
1> Emit warning for throw exception in all noexcept function.  And special diagnostic note for destructor and delete operators.
2> Silence this warning when the throw inside try block.

Let me know if more information is needed.

Thanks.

Jennifer


https://reviews.llvm.org/D33333

Files:
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/Sema.h
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/TreeTransform.h
  test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p1.cpp
  test/CXX/except/except.spec/p11.cpp
  test/SemaCXX/warn-throw-out-dtor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33333.99517.patch
Type: text/x-patch
Size: 10465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170519/64af735b/attachment.bin>


More information about the cfe-commits mailing list