Hi John,

Can you add a test case for this?

 - Daniel

On Thu, Feb 11, 2010 at 2:04 AM, John McCall <[email protected]> wrote:
> Author: rjmccall
> Date: Thu Feb 11 04:04:29 2010
> New Revision: 95870
>
> URL: http://llvm.org/viewvc/llvm-project?rev=95870&view=rev
> Log:
> Suppress warnings if their instantiation location is in a system header, not
> their spelling location.  This prevents warnings from being swallowed just
> because the caret is on the first parenthesis in, say, NULL.
>
> This is an experiment;  the risk is that there might be a substantial number
> of system headers which #define symbols to expressions which inherently cause
> warnings.  My theory is that that's rare enough that it can be worked
> around case-by-case, and that producing useful warnings around NULL is worth
> it.  But I'm willing to accept that I might be empirically wrong.
>
>
> Modified:
>    cfe/trunk/lib/Basic/Diagnostic.cpp
>
> Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=95870&r1=95869&r2=95870&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
> +++ cfe/trunk/lib/Basic/Diagnostic.cpp Thu Feb 11 04:04:29 2010
> @@ -629,7 +629,7 @@
>   // it.
>   if (SuppressSystemWarnings && !ShouldEmitInSystemHeader &&
>       Info.getLocation().isValid() &&
> -      Info.getLocation().getSpellingLoc().isInSystemHeader() &&
> +      Info.getLocation().getInstantiationLoc().isInSystemHeader() &&
>       (DiagLevel != Diagnostic::Note || LastDiagLevel == 
> Diagnostic::Ignored)) {
>     LastDiagLevel = Diagnostic::Ignored;
>     return false;
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to