[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


http://llvm.org/bugs/show_bug.cgi?id=13752

             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
Abrahams:

   http://pfultz2.github.com/Pythy/
   http://cpp-next.com/archive/2011/11/having-it-all-pythy-syntax/

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