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

--- Comment #3 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
So, to clarify, this is not accepts-invalid, nor is it a 4.7->4.9 regression
with regards to whether the function should be accepted. If I change the test
to
be purely C++11, it ICEs on 4.7 and 4.8 as well.

template <class T, class U> struct mypair {
  mypair(T, U) {}
};

template <class T, class U> auto my_make_pair(T t, U u) -> mypair<T, U>
{
  return mypair<T, U>(t, u);
}

template<typename T> struct S {
 mypair<T *, int> get_pair() noexcept { 
   return my_make_pair((T*)nullptr, 0); 
 } 
}; 

static void foo(const mypair<char *, int> (&a)[2]) noexcept { } 

int main()
{ 
  S<char> s; 
  //mypair<char*, int> jones[2]{s.get_pair(), s.get_pair()};
  //foo(jones);
  foo({s.get_pair(), s.get_pair()}); 
}

Reply via email to