https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71784
--- Comment #10 from Ela <mct_ancs at yahoo dot com> --- > ... actually I made it simpler, in order to get to > the root of it: > > --------------- CORRECTION --------------------- #include <iostream> using std::cout; #include <iostream> template<typename T> class A{ public: void f() & ; void f() && ; void g() ; void g(int) ; }; > --------------------------------------------------- #include "e.hh" template<typename T> void A<T>::f() & { std::cout << "lvalue object\n" ; } template<typename T> void A<T>::f() && { std::cout << "rvalue object\n" ; } template<typename T> void A<T>::g() { std::cout << "lvalue object\n" ; } template<typename T> void A<T>::g(int x) { std::cout << "rvalue object\n" ; } extern template class A<int> ; //extern template class A<float> ; //template void A<int>::f(float const&) & ; //template void A<int>::f<int>() && ; template void A<int>::f() &; //template void A<float>::f() && ; template void A<int>::g() ; template void A<int>::g(int) ; > --------------------------------------------------- #include <iostream> #include "e.hh" using std::cout; int main(){ A<int> a ; a.f(); // lvalue // A<float>().f(); // rvalue a.g(); // lvalue a.g(3); // lvalue } > ---------------------------------------------------