Created attachment 27095 [details] reproducer I get: y.cpp: In substitution of 'template<class T> decltype (swap(x.a, y.a)) swap(T&, T&) [with T = A]': y.cpp:11:17: required by substitution of 'template<class T> decltype (swap(x.a, y.a)) swap(T&, T&) [with T = B]' y.cpp:20:14: required from here y.cpp:11:17: error: 'swap' was not declared in this scope y.cpp:11:17: note: suggested alternative: y.cpp:11:17: note: 'swap' y.cpp: In substitution of 'template<class T> decltype (swap(x.a, y.a)) swap(T&, T&) [with T = A]': y.cpp:11:17: required from here y.cpp:11:17: error: 'swap' was not declared in this scope y.cpp:11:17: note: suggested alternative: y.cpp:11:17: note: 'swap' ' Internal compiler error: Error reporting routines re-entered. Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Confirmed.
This is fixed in 4.8.3, 4.9.0 and trunk. I'm adding the testcase and closing the bug.
Author: paolo Date: Sat May 17 20:22:30 2014 New Revision: 210562 URL: http://gcc.gnu.org/viewcvs?rev=210562&root=gcc&view=rev Log: 2014-05-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/52875 * g++.dg/cpp0x/decltype58.C: New. Added: trunk/gcc/testsuite/g++.dg/cpp0x/decltype58.C Modified: trunk/gcc/testsuite/ChangeLog