summaryrefslogtreecommitdiffstats
path: root/clang/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
commitca556cb3e3658637fc1eb3ff68bf348041ac959d (patch)
treeb780b5224e1e1a261b4747fe8a9c30f7db32e462 /clang/lib/Lex/PPDirectives.cpp
parent8d62763779839ccc76977b769d77fb07ab0f8d55 (diff)
downloadbcm5719-llvm-ca556cb3e3658637fc1eb3ff68bf348041ac959d.tar.gz
bcm5719-llvm-ca556cb3e3658637fc1eb3ff68bf348041ac959d.zip
implement PR3940: #line numbers not fully checked
llvm-svn: 69403
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-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