http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30431
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-12 14:55:08 UTC --- (In reply to comment #4) > Something is wrong with the friend lookup after a member of the same name is > encountered. After seeing the class member f (either data member or member > function), gcc forgets that the template function f is in the current > namespace. Nothing is wrong, it just finds 'f' in the class scope so doesn't look in the enclosing namespace. That's how name lookup works in classes. > Bug 17122 is a duplicate, but did not see any activity in 1 year. Yes, and like PR 17122 the code is invalid and G++ is right to reject it, but the diagnostic could be improved. *** This bug has been marked as a duplicate of bug 17122 ***