This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58352] infinite template instantiation depth errors


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."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]