This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31816] If a function foo is defined before declaring a template class A<T>, overloaded version of foo defined after the class declaration will not be available within class A<T>.
- From: "nicolas dot burrus at ensta dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 May 2007 15:53:33 -0000
- Subject: [Bug c++/31816] If a function foo is defined before declaring a template class A<T>, overloaded version of foo defined after the class declaration will not be available within class A<T>.
- References: <bug-31816-14499@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from nicolas dot burrus at ensta dot fr 2007-05-05 16:53 -------
Indeed, you're right, from the standard, section 14.6.3 (non dependent names)
in the template section : "Non-dependent names used in a template definition
are found using the usual name lookup and bound at the
point they are used".
However, in this case, shouldn't g++ be consistent and still fail for
QSet<int*> if void qHash(double) is not defined before the template definition
?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31816