r173970 - Revert "[preprocessor] Don't warn about "disabled expansion of recursive macro""
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Jan 30 12:42:17 PST 2013
Author: akirtzidis
Date: Wed Jan 30 14:42:17 2013
New Revision: 173970
URL: http://llvm.org/viewvc/llvm-project?rev=173970&view=rev
Log:
Revert "[preprocessor] Don't warn about "disabled expansion of recursive macro""
This reverts commit r173952
Modified:
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
cfe/trunk/test/Headers/stdbool.cpp
cfe/trunk/test/Preprocessor/warn-disabled-macro-expansion.c
Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=173970&r1=173969&r2=173970&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Wed Jan 30 14:42:17 2013
@@ -459,10 +459,7 @@ bool Preprocessor::HandleMacroExpandedId
if (MacroInfo *NewMI = getMacroInfo(NewII))
if (!NewMI->isEnabled() || NewMI == MI) {
Identifier.setFlag(Token::DisableExpand);
- // Don't warn for "#define X X" like "#define bool bool" from
- // stdbool.h.
- if (NewMI != MI)
- Diag(Identifier, diag::pp_disabled_macro_expansion);
+ Diag(Identifier, diag::pp_disabled_macro_expansion);
}
}
Modified: cfe/trunk/test/Headers/stdbool.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/stdbool.cpp?rev=173970&r1=173969&r2=173970&view=diff
==============================================================================
--- cfe/trunk/test/Headers/stdbool.cpp (original)
+++ cfe/trunk/test/Headers/stdbool.cpp Wed Jan 30 14:42:17 2013
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -E -dM %s | FileCheck --check-prefix=CHECK-GNU-COMPAT %s
// RUN: %clang_cc1 -std=c++98 -E -dM %s | FileCheck --check-prefix=CHECK-CONFORMING %s
-// RUN: %clang_cc1 -fsyntax-only -std=gnu++98 -verify -Weverything %s
#include <stdbool.h>
#define zzz
@@ -13,7 +12,3 @@
// CHECK-CONFORMING: #define __CHAR_BIT__
// CHECK-CONFORMING-NOT: #define false false
// CHECK-CONFORMING: #define zzz
-
-zzz
-// expected-no-diagnostics
-extern bool x;
Modified: cfe/trunk/test/Preprocessor/warn-disabled-macro-expansion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/warn-disabled-macro-expansion.c?rev=173970&r1=173969&r2=173970&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/warn-disabled-macro-expansion.c (original)
+++ cfe/trunk/test/Preprocessor/warn-disabled-macro-expansion.c Wed Jan 30 14:42:17 2013
@@ -16,7 +16,7 @@
#define z(x) (z)(x)
-p // no warning
+p // expected-warning {{recursive macro}}
a // expected-warning {{recursive macro}}
More information about the cfe-commits
mailing list