Commit 9180555f authored by Orgad Shaneh's avatar Orgad Shaneh

Revert "C++: Fix completion for enum inside member functions"

Breaks loading of qtcreator project.

This reverts commit 4c6ad5e3.

Change-Id: I7c4cdaf57eed16d7643d05b9456e03d5120259b3
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 13c57348
......@@ -824,15 +824,13 @@ ClassOrNamespace *ClassOrNamespace::findBlock(Block *block)
{
flush();
for (ClassOrNamespace *binding = this; binding; binding = binding->_parent) {
QHash<Block *, ClassOrNamespace *>::const_iterator citBlock = binding->_blocks.find(block);
if (citBlock != binding->_blocks.end())
return citBlock.value();
for (citBlock = binding->_blocks.begin(); citBlock != binding->_blocks.end(); ++citBlock) {
if (ClassOrNamespace *foundNestedBlock = citBlock.value()->findBlock(block))
return foundNestedBlock;
}
QHash<Block *, ClassOrNamespace *>::const_iterator citBlock = _blocks.find(block);
if (citBlock != _blocks.end())
return citBlock.value();
for (citBlock = _blocks.begin(); citBlock != _blocks.end(); ++citBlock) {
if (ClassOrNamespace *foundNestedBlock = citBlock.value()->findBlock(block))
return foundNestedBlock;
}
return 0;
......
......@@ -313,6 +313,9 @@ void CppToolsPlugin::test_completion()
QEXPECT_FAIL("enum_in_function_in_struct_in_function", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_in_function_in_struct_in_function_cxx11", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_in_function_in_struct_in_function_anon", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_inside_member_function", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_inside_member_function_cxx11", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_inside_member_function_anon", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_in_class_accessed_in_member_func_cxx11", "QTCREATORBUG-13757", Abort);
QEXPECT_FAIL("enum_in_class_accessed_in_member_func_inline_cxx11", "QTCREATORBUG-13757", Abort);
QCOMPARE(actualCompletions, expectedCompletions);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment