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

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The code looks valid to me. I think that Paolo just wanted to point out that
the library implementation does not cause this. I agree with him and can
confirm that the code is also rejected when emulating the library such as in
the following way:

template<bool, class>
struct enable_if{};

template<class T>
struct enable_if<true, T>{ typedef T type; };

template<class T1, class T2>
struct tuple
{
  T1 t1;
  T2 t2;
};

template<unsigned I, class T1, class T2>
constexpr
typename enable_if<I == 0, T1>::type
get(tuple<T1, T2> t) { return t.t1; }

template<unsigned I, class T1, class T2>
constexpr
typename enable_if<I == 1, T1>::type
get(tuple<T1, T2> t) { return t.t2; }

template<class T1, class T2>
constexpr tuple<T1, T2> make_tuple(T1 t1, T2 t2)
{
  return tuple<T1, T2>{t1, t2};
}

Same error here.

Reply via email to