Skip to content

variable cannot be implicitly captured in a lambda with no capture-default specified #55232

@hewillk

Description

@hewillk

This is a weird bug

#include <array>
#include <tuple>

template<class Tuple>
auto foo() {
  constexpr auto N = std::tuple_size_v<Tuple>;
  constexpr auto M = []<std::size_t... Is>
  (std::index_sequence<Is...>) {
    std::array<std::size_t, N> a{Is...}; // ok
    std::array<std::size_t, N> b{};      // not ok
    return 0;
  }(std::make_index_sequence<N>{});
};

https://godbolt.org/z/h7f1sTW6j

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"duplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions