-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.c++ interopFeature: Interoperability with C++Feature: Interoperability with C++compilerThe Swift compiler itselfThe Swift compiler itself
Description
| 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 errorsThe issue arises when using an inline function to initialize the static member variable.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.c++ interopFeature: Interoperability with C++Feature: Interoperability with C++compilerThe Swift compiler itselfThe Swift compiler itself