From 392c80c6e4b3e0112d4fca50ee3351a6345db3fa Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 18 Sep 2012 12:57:51 +0200 Subject: C++11: Fix use of >> in template arguments. Change-Id: Ic99ca897e7a3b9c82cf8c5093a90bf9c88dbb0ed Reviewed-by: hjk --- src/libs/3rdparty/cplusplus/TranslationUnit.cpp | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/libs/3rdparty/cplusplus/TranslationUnit.cpp') diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp index a26a23eabce..7afef149ef1 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 >::const_iterator it = + _expandedLineColumn.find(tok.offset); + if (it != _expandedLineColumn.end()) { + const std::pair 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)]; -- cgit v1.2.3