зеркало из https://github.com/microsoft/clang-1.git
Fix PR4007: clang doesn't know -Werror-foo is the same as -Werror=foo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
4d8aac3778
Коммит
5b912d9832
|
@ -1,4 +1,5 @@
|
|||
// RUN: clang-cc %s -Eonly -Werror=undef -verify
|
||||
// RUN: clang-cc %s -Eonly -Werror=undef -verify &&
|
||||
// RUN: clang-cc %s -Eonly -Werror-undef -verify
|
||||
|
||||
extern int x;
|
||||
|
||||
|
|
|
@ -121,11 +121,12 @@ bool clang::ProcessWarningOptions(Diagnostic &Diags) {
|
|||
}
|
||||
|
||||
// -Werror/-Wno-error is a special case, not controlled by the option table.
|
||||
// It also has the "specifier" form of -Werror=foo.
|
||||
// It also has the "specifier" form of -Werror=foo and -Werror-foo.
|
||||
if (OptEnd-OptStart >= 5 && memcmp(OptStart, "error", 5) == 0) {
|
||||
const char *Specifier = 0;
|
||||
if (OptEnd-OptStart != 5) { // Specifier must be present.
|
||||
if (OptStart[5] != '=' || OptEnd-OptStart == 6) {
|
||||
if ((OptStart[5] != '=' && OptStart[5] != '-') ||
|
||||
OptEnd-OptStart == 6) {
|
||||
fprintf(stderr, "warning: unknown -Werror warning specifier: -W%s\n",
|
||||
Opt.c_str());
|
||||
continue;
|
||||
|
|
Загрузка…
Ссылка в новой задаче