This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61814] [c++1y] cannot use decltype on captured arg-pack
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Oct 2014 12:31:54 +0000
- Subject: [Bug c++/61814] [c++1y] cannot use decltype on captured arg-pack
- Auto-submitted: auto-generated
- References: <bug-61814-4 at http dot gcc dot gnu dot org/bugzilla/>
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.