public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55914] [C++11] Pack expansion for class member expression fails in lambda expressions
Date: Wed, 09 Jan 2013 10:39:00 -0000	[thread overview]
Message-ID: <bug-55914-4-GxNi2tCyku@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55914-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-01-09 10:39:29 UTC ---
(In reply to comment #1)
> I suspect this is just a different manifestation of PR41933.

Thanks Paolo, I partially agree. Indeed the problem is not depending on class
member expressions (so the issue title should be fixed), a simplified example
can be written as:

//--------------------
struct S {};

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

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

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

with the error:

"9|error: parameter packs not expanded with '...':|
9|note:         'args'|
9|error: expansion pattern 'args' contains no argument packs|
|In instantiation of 'void bar(Args ...) [with Args = {S}]':|
15|required from here|
9|error: using invalid field 'bar(Args ...)::__lambda0::__args'|"

The reason why I hesitate to agree with that being a dup of bug 41933 is due to
the fact that the corresponding example there depends on a language extension
described in

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#904

that is not part of C++11. I do think though, that my revised example above is
indeed conforming C++11 because it does not depend on that grammar extension.

Please keep that in mind when considering the category change to DUP, because
that would have impact on which versions of gcc to patch. For example, I assume
that any CWG defect 904 association would presumably not be applied to gcc
4.7.2.


  parent reply	other threads:[~2013-01-09 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 10:08 [Bug c++/55914] New: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55914-4-GxNi2tCyku@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).