[llvm-bugs] [Bug 25898] New: Exceptions of type pointer to member whose class type is incomplete are not correctly handled

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Dec 19 19:12:27 PST 2015


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

            Bug ID: 25898
           Summary: Exceptions of type pointer to member whose class type
                    is incomplete are not correctly handled
           Product: libc++abi
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

consider:

#include <stdio.h>

struct S;
void f();

#ifndef DEF_S
void f() { throw (int S::*)nullptr; }
#else
struct S {};

int main() {
  try {
    f();
  } catch (int S::*) {
    printf("caught it!\n");
  }
}
#endif

run with:
~/llvm/Debug+Asserts/bin/clang++ -c -stdlib=libc++ -std=c++11 d.cpp -o a.o
~/llvm/Debug+Asserts/bin/clang++ -c -stdlib=libc++ -DDEF_S d.cpp -o b.o
-std=c++11
~/llvm/Debug+Asserts/bin/clang++ a.o b.o -o t -stdlib=libc++

ISTM that libc++abi isn't comparing the NTBS when __incomplete_class_mask is
set in the __pointer_to_member_type_info.

-- 
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/20151220/2ad12003/attachment.html>


More information about the llvm-bugs mailing list