Skip to content

Incorrect type generated for anonymous struct #2358

@llvmbot

Description

@llvmbot
Bugzilla Link 1986
Resolution DUPLICATE
Resolved on May 27, 2008 00:20
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic

Extended Description

The following code

struct s
{
struct {
int a;
int b;
};
void *d;
};

is translated to

%struct.s = type { i8* }

by clang. Also, the warning

Macintosh:clang andersca$ clang -emit-llvm test.c -o -test.c:4:2: warning: declaration does not declare anything
struct {
^

is emitted. GCC correctly emits the following type

%struct.anon = type { i32, i32 }
%struct.s = type { %struct.anon, i8* }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:codegenIR generation bugs: mangling, exceptions, etc.duplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions