From ca556cb3e3658637fc1eb3ff68bf348041ac959d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 17 Apr 2009 23:37:49 +0000 Subject: implement PR3940: #line numbers not fully checked llvm-svn: 69403 --- clang/lib/Lex/PPDirectives.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Lex/PPDirectives.cpp') 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; } -- cgit v1.2.3