forked from qt-creator/qt-creator
CppEditor: Do not treat friend declaration as member function
... when trying to create definitions from declarations. Instead, we completely ignore friends in this context, arguing that the respective function normally should have a proper declaration somewhere else. Fixes: QTCREATORBUG-7164 Change-Id: I3ddb89cefecbc494f9c7e63600b65fd6288b7169 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -2909,6 +2909,19 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_templateFunction()
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_notTriggeredForFriendFunc()
|
||||
{
|
||||
const QByteArray contents =
|
||||
"class Foo\n"
|
||||
"{\n"
|
||||
" friend void f@unc();\n"
|
||||
"};\n"
|
||||
"\n";
|
||||
|
||||
InsertDefFromDecl factory;
|
||||
QuickFixOperationTest(singleDocument(contents, ""), &factory);
|
||||
}
|
||||
|
||||
// Function for one of InsertDeclDef section cases
|
||||
void insertToSectionDeclFromDef(const QByteArray §ion, int sectionIndex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user