dmd/compiler/test/fail_compilation/failcstuff3.c
drpriver f4ca164257
Fix #20499 - [ImportC] typedef struct with name as a pointer cannot be used with struct name (#21232)
Fixes https://github.com/dlang/dmd/issues/20499
Fixes https://github.com/dlang/dmd/issues/20963

ImportC deferred declaring "tagged" types (structs/unions/enums)
until after it saw a possible typedef so that the identifier for
a typedef declaration like:

    typedef struct { int x; } Foo;

would give the struct the name Foo. In several circumstances,
this led to tagged types not being declared. Resolve this by
chasing down those circumstances.

Also, there were other circumstances where types weren't being
correctly declared which caused other issues. Lock those down.
2025-04-15 15:31:21 +08:00

15 lines
312 B
C

// check importAll analysis of C files
/* TEST_OUTPUT:
---
fail_compilation/failcstuff3.c(54): Error: redeclaration of `S22061`
---
*/
/***************************************************/
// https://issues.dlang.org/show_bug.cgi?id=22061
#line 50
struct S22061
{
int field;
};
typedef union S22061 S22061;