forked from OSchip/llvm-project
[frontend] Don't allow a mapping to a warning override an error/fatal mapping.
rdar://10736625 llvm-svn: 149662
This commit is contained in:
parent
1d261d1c0c
commit
d1956e46dd
|
@ -172,6 +172,13 @@ void DiagnosticsEngine::setDiagnosticMapping(diag::kind Diag, diag::Mapping Map,
|
|||
|
||||
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);
|
||||
|
||||
// Common case; setting all the diagnostics of a group in one place.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-purge=none -verify %s -Wreturn-type
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wreturn-type
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -analyzer-purge=none -verify %s -Wno-error=return-type
|
||||
// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core,deadcode,experimental.deadcode.IdempotentOperations,experimental.core -std=gnu99 -analyzer-store=region -analyzer-constraints=range -verify %s -Wno-error=return-type
|
||||
|
||||
typedef unsigned uintptr_t;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -Wreturn-type %s -emit-llvm-only
|
||||
// RUN: %clang_cc1 -Wno-error=return-type %s -emit-llvm-only
|
||||
|
||||
void test1(int x) {
|
||||
switch (x) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang %s -fsyntax-only -Wignored-qualifiers -Wreturn-type -Xclang -verify -fblocks -Wno-unreachable-code -Wno-unused-value
|
||||
// RUN: %clang %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -Xclang -verify -fblocks -Wno-unreachable-code -Wno-unused-value
|
||||
|
||||
// clang emits the following warning by default.
|
||||
// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s -Wnon-pod-varargs
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s -Wno-error=non-pod-varargs
|
||||
|
||||
extern char version[];
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s -Wnon-pod-varargs
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs
|
||||
|
||||
extern char version[];
|
||||
|
||||
|
|
Loading…
Reference in New Issue