This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26536] wrong name lookup in a class template in presence of namespaces
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2006 00:51:17 -0000
- Subject: [Bug c++/26536] wrong name lookup in a class template in presence of namespaces
- References: <bug-26536-2311@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-03-03 00:51 -------
No this should not compile and here is why:
class Rational {
public:
Rational& negate() { return *this; }
};
namespace pm {
Rational& inv_sign(Rational& x) { return x.negate(); }
}
Rational is in the toplevel namespace so that is the only place where argument
dependent lookup will look to find the function inv_sign. Argument dependent
lookup will not relook into the namespace pm.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26536