Bug 21924 - namespace ignored
Summary: namespace ignored
Status: RESOLVED DUPLICATE of bug 7049
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-05 18:06 UTC by andre.maute
Modified: 2006-01-30 18:17 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andre.maute 2005-06-05 18:06:26 UTC
the following code compiles with 3.4.4, 4.0-20050430 
 
---------------------------- 
namespace element { 
struct Element {}; 
void connect( Element* e1, Element* e2 ) {} 
} // namespace element 
 
void foo_connect( element::Element* e1, element::Element* e2 ) { 
        connect(e1,e2); 
} 
---------------------------- 
 
Isn't it necessary to open the namespace in foo_connect?
Comment 1 Andrew Pinski 2005-06-05 18:13:57 UTC
This is how namelookup works for functions.
See the whole section in the standard about this, 3.4.2 [basic.lookup.koenig].

The section is named Argument-dependent name lookup.
Comment 2 Andrew Pinski 2006-01-30 18:17:05 UTC
Reopening to ...
Comment 3 Andrew Pinski 2006-01-30 18:17:20 UTC
Mark as a dup of bug 7049.

*** This bug has been marked as a duplicate of 7049 ***