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

Daniel James dnljms at gmail.com
Wed Mar 16 15:54:00 PDT 2011


On 16 March 2011 22:33, Douglas Gregor <dgregor at apple.com> wrote:
>
> On Mar 16, 2011, at 3:19 PM, Elliot Glaysher (Chromium) wrote:
>
>> Attached is a in-progress patch for a -Wusing-namespace-in-headers.
>> I'm not sure if this is something people would be interested in. If
>> there is, I'll continue working on this.
>
> Seems like a reasonable opt-in warning. Are there other constructs that we should warn about in headers? If so, should they be grouped under the same warning flag?

IMO it should only warn in the global namespace. Importing into a
namespace or function is valid, and often essential. For example,
libstdc++ uses it to avoid ABI issues and boost uses it for functions
that should be in the 'std' namespace, but aren't on some platforms.

Daniel



More information about the cfe-dev mailing list