[llvm-bugs] [Bug 43628] New: Clang crashes if __private_extern__ is undef'd and used in C++

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 9 13:25:12 PDT 2019


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

            Bug ID: 43628
           Summary: Clang crashes if __private_extern__ is undef'd and
                    used in C++
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Compile this C++ code:

#undef __private_extern__
struct ABC {
  static double a;
};
__private_extern__ double ABC::a = 1.0;

This crashes at SemaDecl.cpp:6649 saying:

$ clang -c t.cpp
C storage class in c++!
UNREACHABLE executed at C:\src\llvm-project\clang\lib\Sema\SemaDecl.cpp:6649!

See also https://bugs.llvm.org/show_bug.cgi?id=9375, where I guess a user
wanted us to restrict this extension to MachO platforms.

Noticed while working on https://reviews.llvm.org/D68055.

-- 
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/20191009/68224efb/attachment.html>


More information about the llvm-bugs mailing list