[libcxx-commits] [PATCH] D130283: [libc++] Allow assigning std::rethrow_if_nested() to a function pointer

Xing Xue via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 21 08:53:17 PDT 2022


xingxue created this revision.
xingxue added reviewers: ldionne, Mordante, philnik, hubert.reinterpretcast, cebowleratibm, daltenty.
xingxue added a project: LLVM.
Herald added a project: All.
xingxue requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This patch fixes the error with assigning `std::rethrow_if_nested()` to a function pointer. The fix is similar to what is done for `std::throw_with_nested()`.

The following test case demonstrates the issue.

  #include <exception>
  
  int main()
  {
    struct A {};
    void (*p)(const A&) = &std::rethrow_if_nested<A>;
  }


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130283

Files:
  libcxx/include/exception
  libcxx/test/std/language.support/support.exception/except.nested/call_thru_funcptr.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130283.446510.patch
Type: text/x-patch
Size: 3398 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220721/ee9299eb/attachment-0001.bin>


More information about the libcxx-commits mailing list