[LLVMbugs] [Bug 13752] New: Segfault while compiling. static member initialized (indirectly) via a lambda

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 1 15:34:37 PDT 2012


             Bug #: 13752
           Summary: Segfault while compiling. static member initialized
                    (indirectly) via a lambda
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: aaronmcdaid at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9144
  --> http://llvm.org/bugs/attachment.cgi?id=9144
The preprocessed sources

The compilation segfaults during parsing with this relatively short program.  I
guess it doesn't like the static member being initialized with a lambda.  I've
attached the preprocessed sources.

It works as expected on g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

This following snippet of code might seem pretty strange, but it's based on
part of the PyThy library, which was itself inspired by a blog by Dave


template<typename T>
constexpr typename std::remove_reference<T>::type *addr(T &&) 
            return nullptr;

struct Struct {
        static auto *member = true ? nullptr : addr([](int x, int y) { return
x<y ? x : y; });

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