auto f = [](auto x) noexcept(noexcept(x)) { }; The code above produces the following ICE error message: (On wandbox: http://melpon.org/wandbox/permlink/0RwjRIKwMiUFjsFU) prog.cc:1:45: internal compiler error: in nothrow_spec_p, at cp/except.c:1155 auto f = [](auto x) noexcept(noexcept(x)) { }; ^ 0x668117 nothrow_spec_p(tree_node const*) ../../source/gcc/cp/except.c:1151 0x6c8d7f maybe_add_lambda_conv_op(tree_node*) ../../source/gcc/cp/lambda.c:1096 0x62d22a cp_parser_lambda_expression ../../source/gcc/cp/parser.c:9911 0x62d22a cp_parser_primary_expression ../../source/gcc/cp/parser.c:4978 0x633e87 cp_parser_postfix_expression ../../source/gcc/cp/parser.c:6776 0x634b1d cp_parser_unary_expression ../../source/gcc/cp/parser.c:8124 0x635883 cp_parser_cast_expression ../../source/gcc/cp/parser.c:8801 0x635ff7 cp_parser_binary_expression ../../source/gcc/cp/parser.c:8902 0x6366a4 cp_parser_assignment_expression ../../source/gcc/cp/parser.c:9189 0x636a87 cp_parser_constant_expression ../../source/gcc/cp/parser.c:9459 0x6376e4 cp_parser_initializer_clause ../../source/gcc/cp/parser.c:21586 0x6384fb cp_parser_initializer ../../source/gcc/cp/parser.c:21526 0x647972 cp_parser_init_declarator ../../source/gcc/cp/parser.c:19343 0x6480dd cp_parser_simple_declaration ../../source/gcc/cp/parser.c:12794 0x648cf5 cp_parser_block_declaration ../../source/gcc/cp/parser.c:12619 0x627754 cp_parser_declaration ../../source/gcc/cp/parser.c:12517 0x64d28b cp_parser_declaration_seq_opt ../../source/gcc/cp/parser.c:12393 0x64d572 cp_parser_translation_unit ../../source/gcc/cp/parser.c:4366 0x64d572 c_parse_file() ../../source/gcc/cp/parser.c:38420 0x71b5c3 c_common_parse_file() ../../source/gcc/c-family/c-opts.c:1107
Confirmed, started with r241944.
This is still present. Here are some more examples: int main() { [](auto x) noexcept(noexcept(x)) { } (0); } <source>:3:40: internal compiler error: in nothrow_spec_p, at cp/except.c:1159 [](auto x) noexcept(noexcept(x)) { } (0); ^ int main() { [](auto) noexcept(noexcept(0)) { } (0); } <source>: In function 'int main()': <source>:3:38: internal compiler error: in nothrow_spec_p, at cp/except.c:1159 [](auto) noexcept(noexcept(0)) { } (0); ^
GCC 7.1 has been released.
Author: paolo Date: Mon Oct 2 22:02:03 2017 New Revision: 253369 URL: https://gcc.gnu.org/viewcvs?rev=253369&root=gcc&view=rev Log: 2017-10-02 Paolo Carlini <paolo.carlini@oracle.com> PR c++/79590 * g++.dg/cpp1y/lambda-generic-noexcept1.C: New. Added: trunk/gcc/testsuite/g++.dg/cpp1y/lambda-generic-noexcept1.C Modified: trunk/gcc/testsuite/ChangeLog
The released 7.1.0 is fine. I added the testcases, to be safe.