This bug was apparently considered as solved (see Bug Report 2922), but now gcc 4.1 refuses to compile the attached testcase again, while gcc 3.3 and 3.4 have no problems with it. Note that if you remove the namespace scoping and put everything in the global namespace, the error disappears.
-- Summary: [4.0, 4.1 regression] dependent name lookup fails in presense of namespaces Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gawrilow at math dot tu-berlin dot de GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26563