[cfe-commits] [PATCH] Re: [cfe-dev] Interest in a -Wusing-namespace-in-headers?

Elliot Glaysher (Chromium) erg at chromium.org
Thu Mar 17 11:05:25 PDT 2011


Adds a -Wheader-hygiene warning for warnings that should only trigger
in #included files.

The first -Wheader-hygiene check is to make sure a using directive
isn't placed in the global context in a header.

On Wed, Mar 16, 2011 at 6:15 PM, Douglas Gregor <dgregor at apple.com> wrote:
> You don't need to perform the getDiagnosticLevel() check yourself, because the diagnostic system will handle warning suppression itself.
>
> However, I do suggest performing the CurContext->getDeclKind() == Decl::TranslationUnit check before the isFromMainFile() check, since the former is cheaper.

Done.

-- Elliot Glaysher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: using-namespace-3.diff
Type: text/x-patch
Size: 3555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110317/a9241baf/attachment.bin>


More information about the cfe-commits mailing list