Skip to content

error: definition with same mangled name on method in namespace #991

@ladisgin

Description

@ladisgin

Then trying emit clangir from this code:

namespace nmsp {

struct S {
    void foo() {
    }
};

void bar() {
    S().foo();
}

}

error log:

<source>:4:10: error: definition with same mangled name '_ZN4nmsp1S3fooEv' as another definition
    4 |     void foo() {
      |          ^
<source>:4:10: note: previous definition is here
1 error generated.
Compiler returned: 1

https://godbolt.org/z/fqM7d3GGq

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