Skip to content

[SR-14069] Symbol not in TBD file when initializing a static member variable with an inline function #56458

@swift-ci

Description

@swift-ci
Previous ID SR-14069
Radar rdar://problem/83405989
Original Reporter scentini (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CxxInterop
Assignee None
Priority Medium

md5: 0bf3fb4aec12d9cfe2a92ea0cc046d58

Issue Description:

inline int increment(int t) { return t + 1; }

struct Incrementor { static int incrementee; };

int Incrementor::incrementee = increment(41);

inline int initializeStaticVar() { return Incrementor::incrementee; }

When using the initializeStaticVar() function from Swift, we get an error:

<unknown>:0: error: symbol '_ZN11Incrementor11incrementeeE' (_ZN11Incrementor11incrementeeE) is in generated IR file, but not in TBD file

<unknown>:0: error: please submit a bug report and include the project, and add '-Xfrontend -validate-tbd-against-ir=none' to squash the errors

The issue arises when using an inline function to initialize the static member variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.c++ interopFeature: Interoperability with C++compilerThe Swift compiler itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions