[libcxx-commits] [PATCH] D132873: [libcxxabi] Fix forced_unwind3.pass.cpp compilation error

Aaron Puchert via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 29 11:05:32 PDT 2022


aaronpuchert created this revision.
aaronpuchert added reviewers: danielkiss, mstorsjo.
Herald added a project: All.
aaronpuchert requested review of this revision.
Herald added a project: libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++abi.

Under some circumstances there is no struct _Unwind_Exception, it's just
an alias to another struct. This would result in an error like this:

libcxxabi/test/forced_unwind3.pass.cpp:50:77: error: typedef '_Unwind_Exception' cannot be referenced with a struct specifier

  static _Unwind_Reason_Code stop(int, _Unwind_Action actions, type, struct _Unwind_Exception*, struct _Unwind_Context*,
                                                                            ^

<...>/lib/clang/15.0.0/include/unwind.h:68:38: note: declared here
typedef struct _Unwind_Control_Block _Unwind_Exception; /* Alias */

  ^

This seems to have been an issue since the test was first added in
D109856 <https://reviews.llvm.org/D109856>, except that it didn't surface with Clang 14 because the code
is filtered out by the preprocessor if `__clang_major__ < 15`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132873

Files:
  libcxxabi/test/forced_unwind3.pass.cpp


Index: libcxxabi/test/forced_unwind3.pass.cpp
===================================================================
--- libcxxabi/test/forced_unwind3.pass.cpp
+++ libcxxabi/test/forced_unwind3.pass.cpp
@@ -47,7 +47,7 @@
   // libunwind while _Unwind_Exception_Class in libgcc.
   typedef typename std::tuple_element<2, std::tuple<Args...>>::type type;
 
-  static _Unwind_Reason_Code stop(int, _Unwind_Action actions, type, struct _Unwind_Exception*, struct _Unwind_Context*,
+  static _Unwind_Reason_Code stop(int, _Unwind_Action actions, type, _Unwind_Exception*, struct _Unwind_Context*,
                                   void*) {
     if (actions & _UA_END_OF_STACK) {
       assert(destructorCalled == true);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132873.456412.patch
Type: text/x-patch
Size: 713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220829/957252fd/attachment.bin>


More information about the libcxx-commits mailing list