Issue 24199 - ImportC: generated .di file uses struct keyword when referring to a type
Summary: ImportC: generated .di file uses struct keyword when referring to a type
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ImportC, pull
Depends on:
Blocks:
 
Reported: 2023-10-25 05:44 UTC by dave287091
Modified: 2023-10-28 09:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description dave287091 2023-10-25 05:44:26 UTC
// s.c
struct Foo {
    int x;
};

struct Foo foo(void);

when processed into a .di file:

// s.di
// D import file generated from 's.c'
extern (C)
{
	struct Foo
	{
		int x = void;
	}
	struct Foo foo(); // this is not valid D, remove the `struct`
}
Comment 1 Dlang Bot 2023-10-28 07:52:29 UTC
@WalterBright created dlang/dmd pull request #15740 "fix Issue 24199 - ImportC: generated .di file uses struct keyword whe…" fixing this issue:

- fix Issue 24199 - ImportC: generated .di file uses struct keyword when referring to a type

https://github.com/dlang/dmd/pull/15740
Comment 2 Dlang Bot 2023-10-28 09:07:40 UTC
dlang/dmd pull request #15740 "fix Issue 24199 - ImportC: generated .di file uses struct keyword whe…" was merged into master:

- a61604563a33dffd3428342686e8803bb467b198 by Walter Bright:
  fix Issue 24199 - ImportC: generated .di file uses struct keyword when referring to a type

https://github.com/dlang/dmd/pull/15740