[llvm-bugs] [Bug 52498] New: Clang++ parser segfault on a small file g++ compiles just fine

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 13 11:05:01 PST 2021


            Bug ID: 52498
           Summary: Clang++ parser segfault on a small file g++ compiles
                    just fine
           Product: clang
           Version: 13.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: camille.brugel at laposte.net
                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 25448
  --> https://bugs.llvm.org/attachment.cgi?id=25448&action=edit
TAR archive containing the preprocessed cpp, the full clang++ invocation in a
shell script, and the original file


This is going to sound ironic but I discovered this bug while refactoring the
AST of my (not yet working) compiler. It is quite generic (using template
template parameters) but g++ is able to compile it. I can reproduce it in a
small file (see attachment).

guest at eb0013e54f13:/home/cbrugel/workspace/C++/dmit$ clang++ --version
Ubuntu clang version
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

`clang++ --std=c++20 segfault.cpp` produces a segfault in the parser.

The code I was refactoring (which does compile with clang++):


Let me know if you need some more information.

Best Regards,

Camille BRUGEL

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/20211113/ad3e0b73/attachment-0001.html>

More information about the llvm-bugs mailing list