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

--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> 
2012-11-02 08:57:33 UTC ---
I need to insert another correction. My attempt to simplify the reporters bug
failed because I was mislead by the report description that "visual studio 2012
work fine" interpreting this to mean the Microsoft Visual Studio 2012 compiler.
But that one does not understand 'constexpr' therefore my reduction to 'const'
was not equivalent.

(In reply to comment #1)
> I really think that Pythy should fix this implementation, because it is not
> supported by the C++11 standard. Any compiler accepting that is defect.

This statement still holds. The original code is not conforming.

The following presents a conforming code that reproduces the problem:

template <class T0, class T1>
struct min_t
{
    static bool less(T0 x, T1 y) { return x < y ? x : y; }
    constexpr static auto* f = &less; // #5
};

min_t<int, int> mi; // #8

"8|  required from here|
5|error: declaration of 'constexpr auto* const min_t<int, int>::f' has no
initializer"

Please ignore the part about const T in template deduction. This is a different
issue and not related to this one.

Reply via email to