[LLVMbugs] [Bug 18560] New: decltype as default template argument & C++11 in-class initialization

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 20 10:25:56 PST 2014


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

            Bug ID: 18560
           Summary: decltype as default template argument & C++11 in-class
                    initialization
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: malekchristoph at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang++ -v:
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

====

This code crashes the frontend.
As you can see, only the in-class initialization does not work.


struct some_type
{
    int m_some_member{0};
};

template<typename T, typename Value_Type = decltype(T::m_some_member)>
Value_Type some_func()
{return 10;}

class some_wrapper
{
    int m_some_more_member{some_func<some_type>()}; // CRASH!

public:
    some_wrapper() :
        m_some_more_member{some_func<some_type>()} // WORKS!
    { }

    void some_method() noexcept
    {
        m_some_more_member = some_func<some_type>(); // WORKS!
    }
};

-- 
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/20140120/d7b0f5d7/attachment.html>


More information about the llvm-bugs mailing list