forked from qt-creator/qt-creator
CppTools: Handle operator functions when reformatting */& declarations
Respect also whitespace within the operator names (e.g. "operator=" vs "operator ="). Change-Id: Ibdfc77e9eebf7e3db31ccce7d8959b226dcda765 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -347,6 +347,11 @@ void CppToolsPlugin::test_format_pointerdeclaration_in_simpledeclarations_data()
|
||||
source = QLatin1String("@char bla;"); // Two spaces to get sure nothing is reformatted.
|
||||
QTest::newRow("precondition-fail-no-pointer")
|
||||
<< source << stripCursor(source);
|
||||
|
||||
// Respect white space within operator names
|
||||
QTest::newRow("operators")
|
||||
<< "class C { C@&operator = (const C &); };"
|
||||
<< "class C { C & operator = (const C &); };";
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_format_pointerdeclaration_in_controlflowstatements()
|
||||
|
||||
Reference in New Issue
Block a user