diff --git a/shared/cplusplus/PrettyPrinter.cpp b/shared/cplusplus/PrettyPrinter.cpp index 2acb98b14e185778dc7775c2d9d42cd1fa8bf771..72338576b6b25665a6154cf6bf4090ede03592d9 100644 --- a/shared/cplusplus/PrettyPrinter.cpp +++ b/shared/cplusplus/PrettyPrinter.cpp @@ -1006,10 +1006,13 @@ bool PrettyPrinter::visit(SizeofExpressionAST *ast) bool PrettyPrinter::visit(StringLiteralAST *ast) { - out << '"' << spell(ast->token) << '"'; - if (ast->next) { - out << ' '; - accept(ast->next); + for (StringLiteralAST *it = ast; it; it = it->next) { + if (tokenKind(ast->token) == T_STRING_LITERAL) + out << '"' << spell(ast->token) << '"'; + else + out << "L\"" << spell(ast->token) << '"'; + if (it->next) + out << ' '; } return false; } diff --git a/tests/manual/cplusplus/tests/t1.cpp b/tests/manual/cplusplus/tests/t1.cpp index 5457def79eb3ce19ad3aaf40e5d1d3f40bc9496b..ce6bdcb120dece55d41969c20e45c4ebee184679 100644 --- a/tests/manual/cplusplus/tests/t1.cpp +++ b/tests/manual/cplusplus/tests/t1.cpp @@ -43,6 +43,8 @@ class Class { default: return 2; } + s = L"ci\"aa\"ao" L"blah!"; + s2 = "ciao \"ciao\" ciao"; } };