[cfe-commits] r149662 - in /cfe/trunk: lib/Basic/Diagnostic.cpp test/Analysis/null-deref-ps.c test/CodeGen/statements.c test/Sema/return.c test/SemaCXX/vararg-non-pod.cpp test/SemaObjCXX/vararg-non-pod.mm

Enea Zaffanella zaffanella at cs.unipr.it
Sun Feb 5 08:54:46 PST 2012


On 02/03/2012 02:49 AM, Chad Rosier wrote:
> Author: mcrosier
> Date: Thu Feb  2 19:49:51 2012
> New Revision: 149662
>
> URL: http://llvm.org/viewvc/llvm-project?rev=149662&view=rev
> Log:
> [frontend] Don't allow a mapping to a warning override an error/fatal mapping.

[...]

> Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=149662&r1=149661&r2=149662&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
> +++ cfe/trunk/lib/Basic/Diagnostic.cpp Thu Feb  2 19:49:51 2012
> @@ -172,6 +172,13 @@
>
>     FullSourceLoc Loc(L, *SourceMgr);
>     FullSourceLoc LastStateChangePos = DiagStatePoints.back().Loc;
> +  // Don't allow a mapping to a warning override an error/fatal mapping.
> +  if (Map == diag::MAP_WARNING) {
> +    DiagnosticMappingInfo&Info = GetCurDiagState()->getOrAddMappingInfo(Diag);
> +    if (Info.getMapping() == diag::MAP_ERROR ||
> +        Info.getMapping() == diag::MAP_FATAL)
> +      Map = Info.getMapping();
> +  }
>     DiagnosticMappingInfo MappingInfo = makeMappingInfo(Map, L);


Why this change?

There are warnings that are mapped by default to errors.
After this change, clients no longer have the option of mapping them 
back to warnings, which is obviously wrong.

Please revert this portion of your commit.

Enea.



More information about the cfe-commits mailing list