Skip to content

Inline friend-defined functions when the class is in a namespace #1935

@adalisk-emikhaylov

Description

@adalisk-emikhaylov
namespace NS
{
    struct A
    {
        friend void foo(A) {}
    };
}

CppSharp chokes on this with `options.CheckSymbols = true;.

It generates the following line in the symbols file, which doesn't compile:

void foo(struct NS::A);
void (*_1)(struct NS::A) = &NS::foo;

Here foo should be declared in namespace NS, but gets declared in the global namespace.

This results in:

error: no member named 'foo' in namespace 'NS'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions