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.

Reply via email to