public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55914] New: [C++11] Pack expansion for class member expression fails in lambda expressions
@ 2013-01-09 10:08 daniel.kruegler at googlemail dot com
  2013-01-09 10:24 ` [Bug c++/55914] " paolo.carlini at oracle dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-01-09 10:08 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55914

             Bug #: 55914
           Summary: [C++11] Pack expansion for class member expression
                    fails in lambda expressions
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com


The following code, compiled with 

-Wall -std=c++11 -pedantic

is rejected by gcc 4.7.2 and gcc 4.8.0 20130106 (experimental):

//---------------------
struct S {
  int foo(){ return 0; }
};

template<class... Args>
void evaluate(Args...){}

template <class... Args>
void bar(Args... args) {
  evaluate(args.foo()...); // OK
  auto lmb = [=](){ evaluate(args.foo()...); }; // Error
  lmb();
}

int main() {
  S s{};
  bar(s);
}
//---------------------

"11|error: parameter packs not expanded with '...':|
11|note:         'args'|
In instantiation of 'void bar(Args ...) [with Args = {S}]':|
17|required from here|
11|error: using invalid field 'bar(Args ...)::__lambda0::__args'|
"

The problem also occurs for class member expressions of the form E1->E2 instead
of E1.E2.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-20 15:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-09 10:08 [Bug c++/55914] New: [C++11] Pack expansion for class member expression fails in lambda expressions daniel.kruegler at googlemail dot com
2013-01-09 10:24 ` [Bug c++/55914] " paolo.carlini at oracle dot com
2013-01-09 10:39 ` daniel.kruegler at googlemail dot com
2013-01-09 10:56 ` [Bug c++/55914] [C++11] Pack expansion " paolo.carlini at oracle dot com
2013-01-09 11:00 ` paolo.carlini at oracle dot com
2013-01-09 11:38 ` daniel.kruegler at googlemail dot com
2013-07-04  8:32 ` paolo.carlini at oracle dot com
2013-09-21  8:57 ` paolo.carlini at oracle dot com
2014-11-20 15:49 ` balakrishnan.erode at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).