[LLVMbugs] [Bug 12808] New: clang segfaults during namemangling with nested lambda passed to constexpr constructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 13 05:00:30 PDT 2012


             Bug #: 12808
           Summary: clang segfaults during namemangling with nested lambda
                    passed to constexpr constructor
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 8540
  --> http://llvm.org/bugs/attachment.cgi?id=8540
Complete log of clang run

The following code -- which passes a lambda inside another lambda inside a
template function to a constexpr constructor -- crashes clang r156734:

template <typename>
struct B {
    template <typename L> constexpr B(L&&) {}   // Crashes clang

    //template <typename L> inline B(L&&) {}    // Compiles

template <typename>
void b(int)
    [&]{ B<int>([&]{}); };

int main(int, char**)

This results in (complete log attached):

$ ~/LLVM/build/Release+Asserts/bin/clang++ -v -std=c++11 clang.cpp
clang version 3.2 (trunk 156734)
clang.cpp:12:10: warning: expression result unused [-Wunused-value]
    [&]{ B<int>([&]{}); };
0  clang             0x0000000101565702 PrintStackTrace(void*) + 34
1  clang             0x0000000101565b84 SignalHandler(int) + 692
2  libSystem.B.dylib 0x00007fff881961ba _sigtramp + 26
3  clang             0x0000000100943f1f clang::CXXRecordDecl::bases_end() + 31
4  clang             0x00000001009f5f20 (anonymous
namespace)::CXXNameMangler::manglePrefix(clang::DeclContext const*, bool) + 864

When commenting B's constexpr constructor and uncommenting the non-constexpr
one, the code compiles.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list