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


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-23
                 CC|                            |jason at gcc dot gnu.org
      Known to work|                            |5.0
     Ever confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Actually the original problem is fixed on trunk too (but gives a different
error now), so maybe it is the same and can be reduced to:

int main()
{
  int a{5};
  [&a](auto z) -> void {
    decltype(a) b = a;
  }(1);
}

l.cc: In instantiation of âmain()::<lambda(auto:1)> [with auto:1 = int]â:
l.cc:6:6:   required from here
l.cc:5:17: error: âaâ was not declared in this scope
     decltype(a) b = a;
                 ^

The error goes away if the lambda doesn't have a trailing-return-type, or if
it's not a generic lambda.

Jason, is it worth fixing this on the branch? It only affects C++14 mode.

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