Skip to content

Clang frontend C++ crash when __builtin_dump_struct is used on pointer to undefined type #63506

@mentlerd

Description

@mentlerd

https://godbolt.org/z/fYs6ffrPT

#include <stdio.h>

struct Undefined;

struct Defined {
    Undefined* undef;
};

int main() {
    Undefined* value = nullptr;

    __builtin_dump_struct(value, printf);
    return 0;
}

Compiling this program crashes the clang frontend. Replacing the type of value with Defined emits correct code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions