diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp index 663f87f48a1..cb69289770c 100644 --- a/src/libs/3rdparty/cplusplus/Bind.cpp +++ b/src/libs/3rdparty/cplusplus/Bind.cpp @@ -476,7 +476,7 @@ void Bind::enumerator(EnumeratorAST *ast, Enum *symbol) e->setType(control()->integerType(IntegerType::Int)); // ### introduce IntegerType::Enumerator if (ExpressionAST *expr = ast->expression) - e->setConstantValue(asStringLiteral(expr->firstToken(), expr->lastToken(), false)); + e->setConstantValue(asStringLiteral(expr->firstToken(), expr->lastToken())); symbol->addMember(e); } @@ -1137,13 +1137,12 @@ FullySpecifiedType Bind::trailingReturnType(TrailingReturnTypeAST *ast, const Fu return type; } -const StringLiteral *Bind::asStringLiteral(unsigned firstToken, unsigned lastToken, - bool addWhitespace) +const StringLiteral *Bind::asStringLiteral(unsigned firstToken, unsigned lastToken) { std::string buffer; for (unsigned index = firstToken; index != lastToken; ++index) { const Token &tk = tokenAt(index); - if (addWhitespace && (tk.whitespace() || tk.newline())) + if (index != firstToken && (tk.whitespace() || tk.newline())) buffer += ' '; buffer += tk.spell(); } diff --git a/src/libs/3rdparty/cplusplus/Bind.h b/src/libs/3rdparty/cplusplus/Bind.h index d920c8e9600..9fdab3f9054 100644 --- a/src/libs/3rdparty/cplusplus/Bind.h +++ b/src/libs/3rdparty/cplusplus/Bind.h @@ -105,8 +105,7 @@ protected: void capture(CaptureAST *ast); void lambdaDeclarator(LambdaDeclaratorAST *ast); FullySpecifiedType trailingReturnType(TrailingReturnTypeAST *ast, const FullySpecifiedType &init); - const StringLiteral *asStringLiteral(unsigned firstToken, unsigned lastToken, - bool addWhitespace = true); + const StringLiteral *asStringLiteral(unsigned firstToken, unsigned lastToken); virtual bool preVisit(AST *); virtual void postVisit(AST *);