From 0672d873d0f4b938479de0b5fda3729f7f4dcc96 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 27 Apr 2012 17:11:16 +0200 Subject: [PATCH] preprocessor: concatenate tokens need to preserve previous whitespace Change-Id: Ibca5737ad906c1db7e1bf4e15e5c92030e87c0bb Reviewed-by: Thomas Hartmann --- src/libs/cplusplus/pp-engine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index da8fea3b99f..693bcd54936 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -1549,7 +1549,9 @@ PPToken Preprocessor::generateConcatenated(const PPToken &leftTk, const PPToken newText.reserve(leftTk.length() + rightTk.length()); newText.append(leftTk.tokenStart(), leftTk.length()); newText.append(rightTk.tokenStart(), rightTk.length()); - return generateToken(T_IDENTIFIER, newText.constData(), newText.size(), leftTk.lineno, true); + PPToken result = generateToken(T_IDENTIFIER, newText.constData(), newText.size(), leftTk.lineno, true); + result.f.whitespace = leftTk.f.whitespace; + return result; } void Preprocessor::startSkippingBlocks(const Preprocessor::PPToken &tk) const