diff options
-rw-r--r-- | Basic/SourceManager.cpp | 1 | ||||
-rw-r--r-- | Lex/LiteralSupport.cpp | 4 | ||||
-rw-r--r-- | TODO.txt | 2 | ||||
-rw-r--r-- | clang.xcodeproj/project.pbxproj | 2 | ||||
-rw-r--r-- | test/Lexer/constants.c | 8 |
5 files changed, 14 insertions, 3 deletions
diff --git a/Basic/SourceManager.cpp b/Basic/SourceManager.cpp index a2520e3aff..2177c982d4 100644 --- a/Basic/SourceManager.cpp +++ b/Basic/SourceManager.cpp @@ -339,7 +339,6 @@ unsigned SourceManager::getSourceFilePos(SourceLocation Loc) const { return getFilePos(Loc); } - /// PrintStats - Print statistics to stderr. /// void SourceManager::PrintStats() const { diff --git a/Lex/LiteralSupport.cpp b/Lex/LiteralSupport.cpp index 5d9c7bd11e..8978c796a8 100644 --- a/Lex/LiteralSupport.cpp +++ b/Lex/LiteralSupport.cpp @@ -14,8 +14,9 @@ #include "clang/Lex/LiteralSupport.h" #include "clang/Lex/Preprocessor.h" -#include "clang/Basic/TargetInfo.h" #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/SourceManager.h" +#include "clang/Basic/TargetInfo.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/StringExtras.h" using namespace clang; @@ -261,6 +262,7 @@ NumericLiteralParser(const char *begin, const char *end, if (s == ThisTokEnd) { // Done. } else if (isxdigit(*s)) { + TokLoc = PP.AdvanceToTokenCharacter(TokLoc, s-begin); Diag(TokLoc, diag::err_invalid_octal_digit, std::string(s, s+1)); return; } else if (*s == '.') { @@ -22,6 +22,8 @@ diag.c:4:9: error: invalid digit '8' in octal constant 00080; ^ +This specific diagnostic is implemented, but others should be updated. + //===---------------------------------------------------------------------===// diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index 560076196a..6059d2ac79 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -189,7 +189,7 @@ 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralSupport.cpp; sourceTree = "<group>"; }; 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeList.cpp; path = Parse/AttributeList.cpp; sourceTree = "<group>"; }; 84D9A88B0C1A581300AC7ABC /* AttributeList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AttributeList.h; path = clang/Parse/AttributeList.h; sourceTree = "<group>"; }; - 8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; }; + 8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = clang; sourceTree = BUILT_PRODUCTS_DIR; }; DE01DA480B12ADA300AC22CE /* PPCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCallbacks.h; sourceTree = "<group>"; }; DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExprCXX.cpp; path = Parse/ParseExprCXX.cpp; sourceTree = "<group>"; }; DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = "<group>"; }; diff --git a/test/Lexer/constants.c b/test/Lexer/constants.c new file mode 100644 index 0000000000..f7e4cd02fb --- /dev/null +++ b/test/Lexer/constants.c @@ -0,0 +1,8 @@ +/* RUN: clang -parse-ast-check %s + */ + +int x = 000000080; /* expected-error {{invalid digit}} */ + +int y = 0000\ +00080; /* expected-error {{invalid digit}} */ + |