diff options
author | Christian Kamm <kamm@incasoftware.de> | 2012-09-18 12:57:51 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-09-19 11:58:34 +0200 |
commit | 392c80c6e4b3e0112d4fca50ee3351a6345db3fa (patch) | |
tree | daa2db1fb4d72efffa04d2f00fcdde021f6c282d /src/libs/3rdparty/cplusplus/TranslationUnit.cpp | |
parent | 44c9cef30a022125e8ebc70b7b58c5ad25fafcd6 (diff) |
C++11: Fix use of >> in template arguments.
Change-Id: Ic99ca897e7a3b9c82cf8c5093a90bf9c88dbb0ed
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/TranslationUnit.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/TranslationUnit.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp index a26a23eabc..7afef149ef 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp @@ -552,6 +552,34 @@ unsigned TranslationUnit::findPreviousLineOffset(unsigned tokenIndex) const return lineOffset; } +bool TranslationUnit::maybeSplitGreaterGreaterToken(unsigned tokenIndex) +{ + Token &tok = _tokens->at(tokenIndex); + if (tok.kind() != T_GREATER_GREATER) + return false; + + tok.f.kind = T_GREATER; + tok.f.length = 1; + + Token newGreater; + newGreater.f.kind = T_GREATER; + newGreater.f.expanded = tok.f.expanded; + newGreater.f.generated = tok.f.generated; + newGreater.f.length = 1; + newGreater.offset = tok.offset + 1; + + _tokens->insert(_tokens->begin() + tokenIndex + 1, newGreater); + + std::map<unsigned, std::pair<unsigned, unsigned> >::const_iterator it = + _expandedLineColumn.find(tok.offset); + if (it != _expandedLineColumn.end()) { + const std::pair<unsigned, unsigned> newPosition(it->second.first, it->second.second + 1); + _expandedLineColumn.insert(std::make_pair(newGreater.offset, newPosition)); + } + + return true; +} + void TranslationUnit::showErrorLine(unsigned index, unsigned column, FILE *out) { unsigned lineOffset = _lineOffsets[findLineNumber(_tokens->at(index).offset)]; |