[cfe-dev] Interest in a -Wusing-namespace-in-headers?

Elliot Glaysher (Chromium) erg at chromium.org
Wed Mar 16 15:54:18 PDT 2011


On Wed, Mar 16, 2011 at 3:33 PM, Douglas Gregor <dgregor at apple.com> wrote:
> Are there other constructs that we should warn about in headers? If so, should they be grouped under the same warning flag?

Off the top of my head, the only other warning I can think of is:

namespace {} // expect-warning {{code in anonymous namespaces in
headers may be compiled in multiple translation units}}

> I'd prefer if the warning referred to these entities as "using directives" (both for the warning flag and in the text), since that's the term the standard uses.

I can do that. I included the phrase "using namespace" as I was
worried about users think this would ban UsingDecl, not just
UsingDirectiveDecl.

Regards,

-- Elliot Glaysher



More information about the cfe-dev mailing list