This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36203] explicit member function template lookup fails from templated function
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 May 2008 02:17:18 -0000
- Subject: [Bug c++/36203] explicit member function template lookup fails from templated function
- References: <bug-36203-7638@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from bangerth at dealii dot org 2008-05-11 02:17 -------
(In reply to comment #5)
> Yet Sun, IBM and Microsoft all somehow manage it.
But which function do they take in this case:
--------------
void f();
template <typename T> struct B
{
void f();
};
template <typename T> struct D : B<T>
{
void g()
{
f();
}
};
-------------------
The standard prescribes that in D::g() the function ::f() is called. Are
you suggesting that the compiler pick B::f() instead? Or do you suggest
that the compiler picks B::f() if such a function exists, and ::f() otherwise?
That wouldn't be very intuitive either.
The rules may not always be intuitive, but they're there for a good reason,
not to annoy users.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36203