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"));
|
||||
else if (_fullySpecifiedType.isUnsigned())
|
||||
_text.prepend(QLatin1String("unsigned"));
|
||||
} else if (_fullySpecifiedType.isAuto()) {
|
||||
prependSpaceUnlessBracket();
|
||||
_text.prepend("auto");
|
||||
}
|
||||
|
||||
prependCv(_fullySpecifiedType);
|
||||
|
@@ -1883,17 +1883,17 @@ foo::foo2::MyType<int> foo::foo2::bar()
|
||||
QByteArray original =
|
||||
"class Foo\n"
|
||||
"{\n"
|
||||
" template<class U>\n"
|
||||
" template<class U, auto N>\n"
|
||||
" void fun@c();\n"
|
||||
"};\n";
|
||||
QByteArray expected =
|
||||
"class Foo\n"
|
||||
"{\n"
|
||||
" template<class U>\n"
|
||||
" template<class U, auto N>\n"
|
||||
" void fun@c();\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<class U>\n"
|
||||
"template<class U, auto N>\n"
|
||||
"inline void Foo::func()\n"
|
||||
"{\n"
|
||||
"\n"
|
||||
|
Reference in New Issue
Block a user