This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66538] New: Parameter not in scope of generic lambda trailing decltype
- From: "ldionne.2 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 14 Jun 2015 21:51:38 +0000
- Subject: [Bug c++/66538] New: Parameter not in scope of generic lambda trailing decltype
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66538
Bug ID: 66538
Summary: Parameter not in scope of generic lambda trailing
decltype
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ldionne.2 at gmail dot com
Target Milestone: ---
The following code does not compile on GCC trunk:
auto f = [](auto&& x) -> decltype((void)x) { };
The failure is
error: âxâ was not declared in this scope
Removing the && gives an internal compiler error as a bonus:
auto f = [](auto x) -> decltype((void)x) { };
The failure is
error: âxâ was not declared in this scope
auto f = [](auto x) -> decltype((void)x) { };
^
In lambda function:
internal compiler error: in dependent_type_p, at cp/pt.c:21073
auto f = [](auto x) -> decltype((void)x) { };
^
Finally, please note that the following code compiles fine:
auto f = [](auto&& x) -> decltype(static_cast<void>(x)) { };
Regards,
Louis Dionne