Marc, >> * config/sol2-cxx.c > > You are missing a closing parenthesis in there, on the line with > DECL_NAMESPACE_STD_P. I hadn't dared modify DECL_CONTEXT(decl) because I
drats, I had fixed that in my tree, but forgot to refresh the patch. > was afraid of side effects. > > For instance, in: > namespace std { struct tm {}; } > //void f(std::tm){} > void g(tm){} > > uncommenting the middle line turns the error message from: > e.cc:3:10: error: variable or field 'g' declared void > e.cc:3:8: error: 'tm' was not declared in this scope > e.cc:3:8: note: suggested alternative: > e.cc:1:24: note: 'std::tm' > > to: > e.cc:3:10: error: variable or field 'g' declared void > e.cc:3:8: error: 'tm' was not declared in this scope > e.cc:3:8: note: suggested alternative: > e.cc:1:24: note: 'tm' > > It also breaks argument-dependent lookup: > namespace std { struct tm {}; void h(tm){} } > void g(std::tm x){ h(x); } > > On the other hand, there probably isn't much ADL going on with these 4 > types... > > It might be less invasive to have decl_mangling_context return > global_namespace without actually modifying the expr? Maybe. Let's wait for Jason's comments. > (as already mentioned, I don't know much about gcc internals, I am just > commenting from my experience writing the previous draft patch) Me neither, especially when it gets to the non-port-specific code. Without your draft, I wouldn't probably have arrived at anything remotely sensible. Thanks. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University