зеркало из https://github.com/microsoft/clang-1.git
The keywords "true" and "false" shouldn't warn under -Wundef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
c20c7275c3
Коммит
9c611373cc
|
@ -178,7 +178,9 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
|
|||
// preprocessor keywords and it wasn't macro expanded, it turns
|
||||
// into a simple 0, unless it is the C++ keyword "true", in which case it
|
||||
// turns into "1".
|
||||
if (ValueLive)
|
||||
if (ValueLive &&
|
||||
II->getTokenID() != tok::kw_true &&
|
||||
II->getTokenID() != tok::kw_false)
|
||||
PP.Diag(PeekTok, diag::warn_pp_undef_identifier) << II;
|
||||
Result.Val = II->getTokenID() == tok::kw_true;
|
||||
Result.Val.setIsUnsigned(false); // "0" is signed intmax_t 0.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* RUN: %clang_cc1 -E %s -x c++ | grep block_1
|
||||
RUN: %clang_cc1 -E %s -x c++ | not grep block_2
|
||||
RUN: %clang_cc1 -E %s -x c | not grep block
|
||||
RUN: %clang_cc1 -E %s -x c++ -verify -Wundef
|
||||
*/
|
||||
|
||||
#if true
|
||||
|
|
Загрузка…
Ссылка в новой задаче