[PATCH] D141561: [clang] True `noexcept` (`-fstrict-noexcept` language dialect)

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 11 18:06:41 PST 2023


lebedev.ri created this revision.
lebedev.ri added reviewers: aaron.ballman, rjmccall, efriedma, jcranmer, jyknight, rsmith.
lebedev.ri added a project: LLVM.
Herald added subscribers: StephenFan, dschuff.
Herald added a project: All.
lebedev.ri requested review of this revision.
Herald added subscribers: MaskRay, aheejin.
Herald added a project: clang.

This tentatively implements the following RFC:
https://discourse.llvm.org/t/rfc-clang-true-noexcept-aka-defaults-are-often-wrong-hardcoded-defaults-are-always-wrong/67629

The idea is that when the opt-in is specified,
we turn all EH Terminate scopes into EH UB scopes,
and don't emit any `std::terminate()` calls,
which is the user-facing change.

This probably needs better docs,
and might be missing some pieces.

We might be able to do more to omit more destructor calls.

This is missing UBSan bits, those will be in D137381 <https://reviews.llvm.org/D137381>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141561

Files:
  clang/docs/ReleaseNotes.rst
  clang/docs/UsersManual.rst
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CGCleanup.cpp
  clang/lib/CodeGen/CGCleanup.h
  clang/lib/CodeGen/CGException.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/lib/CodeGen/EHScopeStack.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/CodeGenCXX/exception-escape-as-ub-cleanups.cpp
  clang/test/CodeGenCXX/exception-escape.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141561.488447.patch
Type: text/x-patch
Size: 106398 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230112/0e51121f/attachment-0001.bin>


More information about the cfe-commits mailing list