[Bug c++/52180] New: [DR 1227] [C++11] need to remember whether a return type was specified early or late

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 9 04:01:00 GMT 2012


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

             Bug #: 52180
           Summary: [DR 1227] [C++11] need to remember whether a return
                    type was specified early or late
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jason@gcc.gnu.org


template <class T> struct A { using X = typename T::X; };
template <class T> typename T::X f(typename A<T>::X);
template <class T> void f(...) {}
template <class T> auto g(typename A<T>::X) -> typename T::X;
template <class T> void g(...) {}

void h()
{
  f<int>(0); // OK, substituting return type causes deduction to fail
  g<int>(0); // error, substituting parameter type instantiates A<int>
}



More information about the Gcc-bugs mailing list