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++/63628] [c++1y] cannot use decltype on captured arg-pack


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-23
            Summary|[c++1y] cannot use decltype |[c++1y] cannot use decltype
                   |on captured variable in     |on captured arg-pack
                   |generic lambda              |
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This still fails on trunk, reduced from the original code in PR 61814

    auto const pack = [](auto... t)
    {
        [&]
        {
           int a[] = { static_cast<decltype(t)>(t)... };
        };
    };

    int main() {
        pack(1);
    }

ll.cc: In instantiation of â<lambda(auto:1 ...)>::<lambda()> [with auto:1 =
{int}]â:
ll.cc:5:49:   required from âstruct<lambda(auto:1 ...)> [with auto:1 =
{int}]::<lambda()>â
ll.cc:3:9:   required from â<lambda(auto:1 ...)> [with auto:1 = {int}]â
ll.cc:10:15:   required from here
ll.cc:5:55: error: cannot convert âdecltype (t)â to âintâ in initialization
            int a[] = { static_cast<decltype(t)>(t)... };
                                                       ^
ll.cc:5:55: error: storage size of âaâ isnât known

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