diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 11 |
2 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index f50004c666b..789d9312215 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -296,7 +296,7 @@ SourceLocation Preprocessor::AdvanceToTokenCharacter(SourceLocation TokStart, // the instantiation point (the name). We could point to the source // character, but without also pointing to instantiation info, this is // confusing. - if (CharNo == 0 || TokStart.isMacroID()) return TokStart; + if (CharNo == 0) return TokStart; // Figure out how many physical characters away the specified instantiation // character is. This needs to take into consideration newlines and diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 818a892617e..38cc427a004 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -77,17 +77,12 @@ SourceLocation Sema::getLocationOfStringLiteralByte(const StringLiteral *SL, // The length of the string is the token length minus the two quotes. TokNumBytes -= 2; - - // If we found the token we're looking for, return the location. + // FIXME: This should consider character escapes! + + // If the byte is in this token, return the location of the byte. if (ByteNo < TokNumBytes || (ByteNo == TokNumBytes && TokNo == SL->getNumConcatenated())) { - // If the original token came from a macro expansion, just return the - // start of the token. We don't want to magically jump to the spelling - // for a diagnostic. We do the above business in case some tokens come - // from a macro expansion but others don't. - if (!StrTokLoc.isFileID()) return StrTokLoc; - // We advance +1 to step over the '"'. return PP.AdvanceToTokenCharacter(StrTokLoc, ByteNo+1); } |