[llvm-bugs] [Bug 42080] New: Macro generated try-catch results in abortion of subsequent throw's...

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 30 18:16:44 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42080

            Bug ID: 42080
           Summary: Macro generated try-catch results in abortion of
                    subsequent throw's...
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Paul.Hancock.17041993 at live.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22056
  --> https://bugs.llvm.org/attachment.cgi?id=22056&action=edit
crude testing example source

It seems that the code in a macro, such as this;

>> #define EXCEPTION_ESCAPE_TRY(F, N)  \
>> try {                               \
>>   F;                                \
>> } catch (...)                       \
>> {                                   \
>>   printf("macro catch success");    \
>>   printf(N);                        \
>>   return -1;                        \
>> }

...will be stripped out of existence, for reasons unknown. Even under pedantic
mode, passing a cc* to N will fail to trigger a warning or error, as it
apparently "doesn't even exist".

'F;' will occur still however, but any throw's within will compile as
abort(0)'s, even if the macro itself resides inside a parent try-catch. If the
F; is replaced with a simple throw; the entire macro seems to vanish
entirely...

A crude example source is attached, that tests each general try-catch case
before the macro-generated one. All behaves as expected when jumping through
the debugger, until you get to the macro where it simply abort's...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190531/78fb9d10/attachment-0001.html>


More information about the llvm-bugs mailing list