This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]