[PATCH] D56992: [clang] Mark lambda-to-function-pointer conversion as noexcept

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 21 04:55:20 PST 2019


aaron.ballman edited reviewers, added: rsmith; removed: llvm-commits, doug.gregor.
aaron.ballman added a comment.

> Pre-C++17 standards don't have this requirement; however, they don't forbid the conversion functions to have this specification either.

This change happened as a result of DR 1722 (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1722), so the correct behavior is to treat this as a requirement since the feature was introduced (aka, what you're doing here is correct). You should also update clang/www/cxx_dr_status.html with the change for the DR.



================
Comment at: clang/lib/Sema/SemaLambda.cpp:1231-1232
   // The conversion function is always const.
+  // C++17 also obliges it to be noexcept (which it in fact is),
+  // and previous standards don't forbid that either.
   ConvExtInfo.TypeQuals = Qualifiers();
----------------
I would update the previous comment rather than add this one. `The conversion function is always const with a non-throwing exception specification." or some such.


Repository:
  rC Clang

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

https://reviews.llvm.org/D56992





More information about the cfe-commits mailing list