http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55159



             Bug #: 55159

           Summary: pythy constexpr auto lambda pointer has no initializer

    Classification: Unclassified

           Product: gcc

           Version: unknown

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: supercilious.d...@gmail.com





Pythy (http://pfultz2.github.com/Pythy/) does something akin to:



template <typename T> 

typename std::remove_reference<T>::type *addr(T &&t) 

{ 

    return &t; 

}



template <class T0, class T1>

struct min_t

{

    constexpr static auto *f =

        false ? addr([](T0 x, T1 y){ return x < y ? x : y; }) : nullptr; 

};



Which gcc (4.7.2 and 4.8.0 git master) cannot evaluate.

clang and visual studio 2012 work fine.



I know this is not strictly needed by gcc 4.8 since it has deduced auto without

the late specifier (which the other compilers lack), but its highly convenient

to have pythy work on all c++11 compilers.

Reply via email to