Bug 67370 - Invalid "parameter packs not expanded" error in lambda capture
Summary: Invalid "parameter packs not expanded" error in lambda capture
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: 8.0
Assignee: Not yet assigned to anyone
URL:
Keywords: c++-lambda
Depends on:
Blocks: lambdas
  Show dependency treegraph
 
Reported: 2015-08-27 11:47 UTC by Louis Dionne
Modified: 2022-03-11 00:32 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-09-30 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Dionne 2015-08-27 11:47:58 UTC
The following code does not compile with GCC trunk:

    template <typename ...T>
    void expand(T const& ...);
    
    template <typename ...T>
    void f(T ...t) {
        expand([t]{ }...);
    }


The error is

    [snip]: In function 'void f(T ...)':
    [snip]: error: parameter packs not expanded with '...':
         expand([t]{ }...);
                 ^
    [snip]: note:         't'
    [snip]: error: parameter packs not expanded with '...':
         expand([t]{ }...);
                  ^


Live example: http://melpon.org/wandbox/permlink/uKHsTOctM4EbNTpi
Comment 1 Jonathan Wakely 2015-08-27 11:55:55 UTC
Almost certainly a dup of PR 64488 and PR 47226
Comment 2 Paolo Carlini 2017-09-30 20:51:02 UTC
Interestingly, it's still an issue in trunk.
Comment 3 paolo@gcc.gnu.org 2018-03-03 18:09:58 UTC
Author: paolo
Date: Sat Mar  3 18:09:27 2018
New Revision: 258218

URL: https://gcc.gnu.org/viewcvs?rev=258218&root=gcc&view=rev
Log:
2018-03-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/67370
	* g++.dg/cpp0x/lambda/lambda-67370.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-67370.C
Modified:
    trunk/gcc/testsuite/ChangeLog
Comment 4 Paolo Carlini 2018-03-03 18:11:44 UTC
Fixed in trunk.