diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp index b184e2a1e1a..d6a2ce84fac 100644 --- a/src/libs/cplusplus/TypePrettyPrinter.cpp +++ b/src/libs/cplusplus/TypePrettyPrinter.cpp @@ -531,7 +531,10 @@ void TypePrettyPrinter::visit(Function *type) // add exception specifier if (const StringLiteral *spec = type->exceptionSpecification()) { - appendSpace(); + if (type->refQualifier() != Function::NoRefQualifier) + _text.append(' '); + else + appendSpace(); _text += QLatin1String(spec->chars()); } } diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index c0ee38d6e27..a2ed383c12f 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -6137,7 +6137,7 @@ struct Derived : public Base { original = "#include \"file.h\"\n"; expected = R"DELIM(#include "file.h" -auto Derived::func() const &&noexcept -> void {} +auto Derived::func() const && noexcept -> void {} )DELIM"; testDocuments << CppTestDocument::create("file.cpp", original, expected);