[Bug c++/64488] [c++11] Expand initializer list with lambdas in variadic template. Reject valid code.

vittorio.romeo at outlook dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 20 10:48:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64488

Vittorio Romeo <vittorio.romeo at outlook dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vittorio.romeo at outlook dot com

--- Comment #3 from Vittorio Romeo <vittorio.romeo at outlook dot com> ---
Further simplification:

    template <int... Is>
    void foo() 
    {
        using arr = int(*[])();
        (void) arr{[]{ return Is; }...};
    }

    int main() { foo<1,2,3>(); }



* clang++ 3.3 (up to 5.0) happily compiles the code with -std=c++11.

* g++ 4.7 (up to 7.0) fails to compile with -std=c++11 (or c++14/c++1z)


More information about the Gcc-bugs mailing list