summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index ce86d0edca0..2dfb6233bdf 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -650,6 +650,11 @@ static bool GetLineValue(Token &DigitTok, unsigned &Val,
return true;
}
+ // Warn about hex and octal line numbers. Do this after the check for 0,
+ // because it is octal.
+ if (Literal.getRadix() != 10)
+ PP.Diag(DigitTok, diag::warn_pp_line_decimal);
+
return false;
}
OpenPOWER on IntegriCloud