aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-17 23:37:49 +0000
committerChris Lattner <sabre@nondot.org>2009-04-17 23:37:49 +0000
commit58e91d57510a5ce4fd424fe7fd1cdfa86701ef35 (patch)
tree732b1fd8e5c9492b61bd5f6b960013a93cd224c9 /lib/Lex/PPDirectives.cpp
parentab82f41b217ce588a9456c0b4411f219d3ed0df8 (diff)
implement PR3940: #line numbers not fully checked
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r--lib/Lex/PPDirectives.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index ce86d0edca..2dfb6233bd 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/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;
}