This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58352] infinite template instantiation depth errors
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 Sep 2013 12:03:56 +0000
- Subject: [Bug c++/58352] infinite template instantiation depth errors
- Auto-submitted: auto-generated
- References: <bug-58352-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58352
Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler@googlemail.
| |com
--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> ---
The code example has undefined behaviour and moving your specialization to the
top is required to make it work. You hit [temp.dep.candidate] p1:
"For a function call where the postfix-expression is a dependent name, the
candidate functions are found using
the usual lookup rules (3.4.1, 3.4.2) except that:
â For the part of the lookup using unqualified name lookup (3.4.1), only
function declarations from the template definition context are found.
[..]
If the call would be ill-formed or would find a better match had the lookup
within the associated namespaces considered all the function declarations with
external linkage introduced in those namespaces in all translation units, not
just considering those declarations found in the template definition and
template
instantiation contexts, then the program has undefined behavior."