[llvm-bugs] [Bug 48396] New: Segfault from export of nested struct

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 4 13:16:11 PST 2020


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

            Bug ID: 48396
           Summary: Segfault from export of nested struct
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ndkrempel at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

The following code, compiled with -std=c++20, causes a segfault during parsing:

  export module M;
  struct A { struct B; };
  export struct A::B {};

Reproduced in clang 10.0.0, 11.0.0, and trunk.

(The one-liner "class A{};export class A::B{}" will also repro it.)

Stack trace from trunk (https://gcc.godbolt.org/z/shr6nE):

Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang++ -g -o
./output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics
-fno-crash-diagnostics -std=c++20 <source>
1.      <source>:3:20: current parser token '{'
#0 0x000055b863afd56c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2e1d56c)
#1 0x000055b863afb304 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2e1b304)
#2 0x000055b863afb595 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2e1b595)
#3 0x000055b863a6a0e8 CrashRecoverySignalHandler(int)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x2d8a0e8)
#4 0x00007f346a21d3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
clang-12: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
Compiler returned: 139

-- 
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/20201204/a0ea9414/attachment.html>


More information about the llvm-bugs mailing list