This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52180] New: [DR 1227] [C++11] need to remember whether a return type was specified early or late
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Feb 2012 04:00:58 +0000
- Subject: [Bug c++/52180] New: [DR 1227] [C++11] need to remember whether a return type was specified early or late
- Auto-submitted: auto-generated
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>
}