https://bugs.llvm.org/show_bug.cgi?id=49387

            Bug ID: 49387
           Summary: Pack expansion failure with template lambda and
                    std::index_sequence
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: vittorio.ro...@outlook.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

#include <utility>

struct S 
{
    template <int> using N = int;
    static constexpr int size = 5;
};

static void f()
{
    const auto l = [&]<typename>() {};

    [&]<std::size_t... Is>(std::index_sequence<Is...>)
    {
        ((l
                 .template operator()<typename S::template N<Is>>()),
            ...);
    }
    (std::make_index_sequence<S::size> {});
}

The code above results in an incorrect compilation failure with the following
message:

<source>:17:13: error: pack expansion does not contain any unexpanded parameter
packs
            ...);
            ^
1 error generated.
Compiler returned: 1

The code should instead compile. Live on Compiler Explorer:
https://gcc.godbolt.org/z/rMvY3o

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to