[cfe-dev] Interest in a -Wusing-namespace-in-headers?
Douglas Gregor
dgregor at apple.com
Wed Mar 16 17:39:11 PDT 2011
On Mar 16, 2011, at 4:51 PM, Daniel James wrote:
> On 16 March 2011 22:56, Douglas Gregor <dgregor at apple.com> wrote:
>>
>> IIRC, libstdc++ does it with "strong using" directives (which Clang doesn't support).
>
> Sorry, I meant libc++. It certainly uses using directives.
I see using directives only at function scope in libc++ (and we certainly don't want to warn about those). But anyway, I agree with your meta-point.
>> Boost, I assume, only does this for using declarations; that's not what the patch is about.
>
> No, because we don't know if the function is in the std namespace, so
> we can't use a using declaration. They're used for other reasons as
> well.
>
> But it doesn't really matter where it is or isn't used. What matters
> is that a properly scoped import is usually safe, and warning about
> one would be counter productive.
I agree.
- Doug
More information about the cfe-dev
mailing list