File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4267,6 +4267,8 @@ void SymbolDatabase::printXml(std::ostream &out) const
42674267 outs += " isInlineKeyword=\" true\" " ;
42684268 if (function->isStatic ())
42694269 outs += " isStatic=\" true\" " ;
4270+ if (function->isFriend ())
4271+ outs += " isFriend=\" true\" " ;
42704272 if (function->isAttributeNoreturn ())
42714273 outs += " isAttributeNoreturn=\" true\" " ;
42724274 if (const Function* overriddenFunction = function->getOverriddenFunction ()) {
Original file line number Diff line number Diff line change @@ -607,6 +607,8 @@ class TestSymbolDatabase : public TestFixture {
607607 TEST_CASE (incomplete_type); // #9255 (infinite recursion)
608608 TEST_CASE (exprIds);
609609 TEST_CASE (testValuetypeOriginalName);
610+
611+ TEST_CASE (dumpFriend); // Check if isFriend added to dump file
610612 }
611613
612614 void array () {
@@ -11073,6 +11075,19 @@ class TestSymbolDatabase : public TestFixture {
1107311075 ASSERT (tok->valueType ()->constness == 0 );
1107411076 }
1107511077 }
11078+
11079+ void dumpFriend () {
11080+ GET_SYMBOL_DB (" class Foo {\n "
11081+ " Foo();\n "
11082+ " int x{};\n "
11083+ " friend bool operator==(const Foo&lhs, const Foo&rhs) {\n "
11084+ " return lhs.x == rhs.x;\n "
11085+ " }\n "
11086+ " };" );
11087+ std::ostringstream ostr;
11088+ db->printXml (ostr);
11089+ ASSERT (ostr.str ().find (" isFriend=\" true\" " ) != std::string::npos);
11090+ }
1107611091};
1107711092
1107811093REGISTER_TEST (TestSymbolDatabase)
You can’t perform that action at this time.
0 commit comments