https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86739

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The code is well-formed according to
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#106 but that
doesn't seem to be implemented in GCC 4.1.2

template<typename T>
struct X {
    X(T&) { }
};

X<int&> f(int& i)
{
    return X<int&>(i);
}

<source>: In instantiation of 'X<int&>':
<source>:6:   instantiated from here
<source>:3: error: forming reference to reference type 'int&'

Reply via email to