Skip to content

ICE on use of constexpr in lambda parameter type #47400

Closed
@ldalessa

Description

@ldalessa
Bugzilla Link 48056
Version trunk
OS All
CC @zygoloid

Extended Description

Forgive me, this one's a bit hard to describe and/or search for, so it's possibly a duplicate.

https://godbolt.org/z/c1P9sr

#include <array>
#include <utility>

struct Foo {
    int n;
};

constexpr bool foo() {
    constexpr std::array<Foo, 2> foos = { 1, 2 };
    [&]<std::size_t... is>(std::index_sequence<is...>) {
        ([&](std::array<int, foos[is].n>) {}, ...);
    }(std::make_index_sequence<size(foos)>());
    return true;
}

static_assert(foo());

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions