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++/26536] wrong name lookup in a class template in presence of namespaces



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


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