From 92c14bb2ff85d16785140c93493d97060ffcf2e7 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 16 Dec 2014 21:16:10 +0000 Subject: Move -Wkeyword-macro into -pedantic, remove -Wreserved-id-macro. As discussed on the post-commit review thread for r224012, -Wkeyword-macro fires mostly on headers trying to set up portable defines and doesn't find much bad stuff in practice. But [macro.names]p2 does disallow defining or undefining keywords, override and final, and alignas, so keep the warning but move it into -pedantic. -Wreserved-id-macro warns on #define __need_size_t which is more or less public api for glibc headers. Since this warning isn't motivated by a standard, remove it. (See also r223114 for a previous follow-up to r224012.) llvm-svn: 224371 --- clang/test/Preprocessor/macro-reserved.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'clang/test/Preprocessor/macro-reserved.cpp') diff --git a/clang/test/Preprocessor/macro-reserved.cpp b/clang/test/Preprocessor/macro-reserved.cpp index 8529ddffa1b..087c27e1ab1 100644 --- a/clang/test/Preprocessor/macro-reserved.cpp +++ b/clang/test/Preprocessor/macro-reserved.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only %s -verify +#pragma clang diagnostic warning "-Wkeyword-macro" + #define for 0 // expected-warning {{keyword is hidden by macro definition}} #define final 1 // expected-warning {{keyword is hidden by macro definition}} #define __HAVE_X 0 @@ -10,16 +12,14 @@ #undef _HAVE_X #undef X__Y -#pragma clang diagnostic warning "-Wreserved-id-macro" - #define switch if // expected-warning {{keyword is hidden by macro definition}} #define final 1 // expected-warning {{keyword is hidden by macro definition}} -#define __HAVE_X 0 // expected-warning {{macro name is a reserved identifier}} -#define _HAVE_X 0 // expected-warning {{macro name is a reserved identifier}} -#define X__Y // expected-warning {{macro name is a reserved identifier}} +#define __HAVE_X 0 +#define _HAVE_X 0 +#define X__Y -#undef __cplusplus // expected-warning {{macro name is a reserved identifier}} -#undef _HAVE_X // expected-warning {{macro name is a reserved identifier}} -#undef X__Y // expected-warning {{macro name is a reserved identifier}} +#undef __cplusplus +#undef _HAVE_X +#undef X__Y int x; -- cgit v1.2.3