forked from qt-creator/qt-creator
CppEditor: Fix pretty-printing of auto type
Task-number: QTCREATORBUG-31678 Change-Id: I2c1684c71315d50c98f451b280fbfd08b5d8d3e8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -116,6 +116,9 @@ void TypePrettyPrinter::visit(UndefinedType *)
|
|||||||
_text.prepend(QLatin1String("signed"));
|
_text.prepend(QLatin1String("signed"));
|
||||||
else if (_fullySpecifiedType.isUnsigned())
|
else if (_fullySpecifiedType.isUnsigned())
|
||||||
_text.prepend(QLatin1String("unsigned"));
|
_text.prepend(QLatin1String("unsigned"));
|
||||||
|
} else if (_fullySpecifiedType.isAuto()) {
|
||||||
|
prependSpaceUnlessBracket();
|
||||||
|
_text.prepend("auto");
|
||||||
}
|
}
|
||||||
|
|
||||||
prependCv(_fullySpecifiedType);
|
prependCv(_fullySpecifiedType);
|
||||||
|
@@ -1883,17 +1883,17 @@ foo::foo2::MyType<int> foo::foo2::bar()
|
|||||||
QByteArray original =
|
QByteArray original =
|
||||||
"class Foo\n"
|
"class Foo\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" template<class U>\n"
|
" template<class U, auto N>\n"
|
||||||
" void fun@c();\n"
|
" void fun@c();\n"
|
||||||
"};\n";
|
"};\n";
|
||||||
QByteArray expected =
|
QByteArray expected =
|
||||||
"class Foo\n"
|
"class Foo\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" template<class U>\n"
|
" template<class U, auto N>\n"
|
||||||
" void fun@c();\n"
|
" void fun@c();\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
"\n"
|
"\n"
|
||||||
"template<class U>\n"
|
"template<class U, auto N>\n"
|
||||||
"inline void Foo::func()\n"
|
"inline void Foo::func()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
Reference in New Issue
Block a user