Skip to content

Commit 0fb00fb

Browse files
autoantwortclaude
andcommitted
Add test for pointer to member function returning a reference
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6b8f345 commit 0fb00fb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎test/testsymboldatabase.cpp‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,16 @@ class TestSymbolDatabase : public TestFixture {
16271627
ASSERT(p->valueType());
16281628
ASSERT(p->valueType()->reference == Reference::None);
16291629
}
1630+
{ // pointer to member function returning a reference
1631+
GET_SYMBOL_DB("struct S { int& g(); };\n"
1632+
"void foo(int& (S::*pm)()) {}\n");
1633+
const Variable* const p = db->getVariableFromVarId(1);
1634+
ASSERT(p);
1635+
ASSERT_EQUALS("pm", p->name());
1636+
ASSERT(!p->isReference());
1637+
ASSERT(p->valueType());
1638+
ASSERT(p->valueType()->reference == Reference::None);
1639+
}
16301640
{ // reference to function pointer
16311641
GET_SYMBOL_DB("void foo(int (*&f)()) {}\n");
16321642
const Variable* const p = db->getVariableFromVarId(1);

0 commit comments

Comments
 (0)