Skip to content

ASSERT_VAL in member initializer of constexpr constructor causes ICE on GCC #157

@CrackedMatter

Description

@CrackedMatter

Using ASSERT_VAL in a member initializer of a constexpr constructor causes an ICE on GCC:

// internal compiler error: in bot_manip, at cp/tree.cc:3280
struct a {
    constexpr a() : b{ASSERT_VAL(1)} {}
    int b;
};

The error appears to be triggered when a name is introduced within a statement expression (https://godbolt.org/z/38x1E1jY6):

struct a {
    int b;
    constexpr a() : b{({
        int c{}; // struct d; typedef int e; ...
        1;
    })} {}
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions