From 449a7e2b4ff114a72be573013558bae19672ebbc Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 18 Dec 2018 22:12:14 +0100 Subject: Redundant whitespace removal breaks some C++ links [with test case and Git bisect] (Origin: bugzilla #791942) --- src/util.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index a1f40af..1b6afa2 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1895,11 +1895,18 @@ QCString removeRedundantWhiteSpace(const QCString &s) if (g_charAroundSpace.charMap[(uchar)pc].before && g_charAroundSpace.charMap[(uchar)nc].after && !(pc==',' && nc=='.') && - (osp<8 || (osp>=8 && isId(nc))) // e.g. "operator >>" -> "operator>>", but not "operator int" -> operatorint" + (osp<8 || (osp>=8 && pc!='"' && isId(nc)) || (osp>=8 && pc!='"' && nc!='"')) + // e.g. 'operator >>' -> 'operator>>', + // 'operator "" _x' -> 'operator""_x', + // but not 'operator int' -> 'operatorint' ) { // keep space *dst++=' '; } + else if ((pc=='*' || pc=='&' || pc=='.') && nc=='>') + { + *dst++=' '; + } } break; default: -- cgit v0.12