Skip to content

Don't generate functions named 'nil'#28

Open
slburson wants to merge 1 commit into
borodust:masterfrom
slburson:no-functions-named-nil
Open

Don't generate functions named 'nil'#28
slburson wants to merge 1 commit into
borodust:masterfrom
slburson:no-functions-named-nil

Conversation

@slburson

@slburson slburson commented Jul 1, 2026

Copy link
Copy Markdown

Given something like this:

struct IValue {
    union Payload {
        union TriviallyCopyablePayload {
            TriviallyCopyablePayload() : as_int(0) {}
            long as_int;
            unsigned as_uint;
            double as_double;
            bool as_bool;
            struct {                   // <-- unnamed struct
                char type;
                char index;
            } as_device;
        } u;
        Payload(const Payload&) = delete;
        Payload(Payload&&) = delete;
        Payload& operator=(const Payload&) = delete;
        Payload& operator=(Payload&&) = delete;
    };
};

libclang generates an assignment operator for the unnamed struct. I'm not quite sure why it does that; as I recall, it didn't do it without the delete declarations, though I'm not sure all four are needed. Anyway, the outcome was that claw.iffi.cxx::symbolicate-function-name would return nil, which caused predictable breakage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant