OK.
On Mon, Oct 9, 2017 at 6:37 AM, Paolo Carlini <paolo.carl...@oracle.com> wrote: > Hi, > > this issue filed by Bernd is sort-of a small follow-up to his c++/71973: the > C front-end already warns for things like: > > int printf; > > where we are declaring in the global namespace a built-in. Beyond copying > over to the C++ front-end the code already existing in the C front-end, > there are a couple of nits: 1- We probably want to enable suppressing the > warning, give it a name, for this I'm overloading the name already added by > Bernd for c++/71973 (using it in the C front-end too, without changes to the > default behavior, seems a very safe tweak to me); 2- as a pure C++ nit, we > probably want to take into account namespaces, thus the additional check > CP_DECL_CONTEXT (newdecl) == global_namespace and the new C++ test (for a > couple of hours I had in the tree CP_DECL_CONTEXT (newdecl) == > CP_DECL_CONTEXT (olddecl), probably unnecessarily more verbose!?). What > else? A couple of existing C++ testcases needed rather obvious adjusting, > note in particular g++.old-deja/g++.mike/p811.C, which has flattened in the > global namespace a declaration 'extern ostream clog;', which, were in > namespace std, as per the standard, would not trigger the new warning, even > if 'clog' is also the name of a math builtin, thanks to the additional check > mentioned above. Tested x86_64. > > Thanks, Paolo. > > ////////////////// >