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++/36203] explicit member function template lookup fails from templated function



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


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