File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1812,7 +1812,7 @@ namespace {
18121812 const ScopeInfo3 * tempScope = this ;
18131813 while (tempScope) {
18141814 for (const auto & child : tempScope->children ) {
1815- if (child.name == scope || child.fullName == scope)
1815+ if (child.type == Record && (child. name == scope || child.fullName == scope) )
18161816 return &child;
18171817 }
18181818
Original file line number Diff line number Diff line change @@ -974,6 +974,33 @@ class TestSimplifyUsing : public TestFixture {
974974 ASSERT_EQUALS (exp, tok (code, true ));
975975 ASSERT_EQUALS (" " , errout.str ());
976976 }
977+ {
978+ const char code[] = " foo::ResultCodes_e\n "
979+ " GemImpl::setR(const ::foo::s _ipSource)\n "
980+ " {\n "
981+ " M3_LOG_EE_DEBUG();\n "
982+ " using MLSource = foo::s::Literal;\n "
983+ " auto ret = foo::ResultCodes_e::NO_ERROR;\n "
984+ " M3_LOG_INFO(\" foo(\" << static_cast<int>(_ipSource) << \" )\" );\n "
985+ " return ret;\n "
986+ " }\n "
987+ " foo::ResultCodes_e\n "
988+ " GemImpl::getF(::foo::s &_ipSource)\n "
989+ " {\n "
990+ " M3_LOG_EE_DEBUG();\n "
991+ " auto ret = foo::ResultCodes_e::NO_ERROR;\n "
992+ " return ret;\n "
993+ " }\n "
994+ " foo::ResultCodes_e\n "
995+ " GemImpl::setF(const ::foo::s _ipSource)\n "
996+ " {\n "
997+ " M3_LOG_EE_DEBUG();\n "
998+ " using MLSource = foo::s::Literal;\n "
999+ " auto ret = foo::ResultCodes_e::NO_ERROR;\n "
1000+ " return ret;\n "
1001+ " }" ;
1002+ tok (code, true ); // don't crash
1003+ }
9771004 }
9781005
9791006 void simplifyUsing10171 () {
You can’t perform that action at this time.
0 commit comments