[Bug c++/46733] New: [c++0x] member function template is used for copy-construction when it should not
roman at binarylife dot net
gcc-bugzilla@gcc.gnu.org
Tue Nov 30 23:53:00 GMT 2010
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46733
Summary: [c++0x] member function template is used for
copy-construction when it should not
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: roman@binarylife.net
Compiling the following invalid program GCC violates 12.8/7 "A member function
template is never instantiated to perform the copy of a class object to an
object of its class type."
$ cat test.cpp
#include <cstdlib>
struct X {
X()=default;
X(X&&)=default;
template<typename Y> X(Y const&) { abort(); }
};
int main() {
X a={};
X b(a);
return 0;
}
$ g++ -std=c++0x test.cpp && ./a.out
Aborted
More information about the Gcc-bugs
mailing list