Input: class { &a; b(decltype(((a = 0) || ((auto))))) }; Output: $ xgcc -x c++ -S - <stdin>:2:4: error: ISO C++ forbids declaration of 'a' with no type [-fpermissive] <stdin>:3:28: error: expected primary-expression before 'auto' <stdin>:3:28: error: expected ')' before 'auto' <stdin>:3:37: error: expected ')' before '}' token <stdin>:4:1: internal compiler error: Segmentation fault 0x3155789 crash_signal /home/vegard/git/gcc/gcc/toplev.c:325 0x400d828 strip_array_types(tree_node*) /home/vegard/git/gcc/gcc/tree.c:7932 0x139c9d0 cp_type_quals(tree_node const*) /home/vegard/git/gcc/gcc/cp/typeck.c:9585 0x136f3dc cv_unqualified(tree_node*) /home/vegard/git/gcc/gcc/cp/tree.c:1286 0xa4dc38 initialized_type /home/vegard/git/gcc/gcc/cp/constexpr.c:2707 0xa4dc38 cxx_eval_outermost_constant_expr /home/vegard/git/gcc/gcc/cp/constexpr.c:4794 0xa5b966 maybe_constant_value(tree_node*, tree_node*) /home/vegard/git/gcc/gcc/cp/constexpr.c:5044 0xaba942 cp_fully_fold(tree_node*) /home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2040 0xec86a3 cp_parser_binary_expression /home/vegard/git/gcc/gcc/cp/parser.c:9298 0xec95aa cp_parser_assignment_expression /home/vegard/git/gcc/gcc/cp/parser.c:9484 0xecbaca cp_parser_expression /home/vegard/git/gcc/gcc/cp/parser.c:9653 0xf3833e cp_parser_primary_expression /home/vegard/git/gcc/gcc/cp/parser.c:5204 0xf7a2eb cp_parser_postfix_expression /home/vegard/git/gcc/gcc/cp/parser.c:7028 0xf2e057 cp_parser_unary_expression /home/vegard/git/gcc/gcc/cp/parser.c:8320 0xec31aa cp_parser_cast_expression /home/vegard/git/gcc/gcc/cp/parser.c:9088 0xec57d6 cp_parser_binary_expression /home/vegard/git/gcc/gcc/cp/parser.c:9189 0xec95aa cp_parser_assignment_expression /home/vegard/git/gcc/gcc/cp/parser.c:9484 0xecbaca cp_parser_expression /home/vegard/git/gcc/gcc/cp/parser.c:9653 0xf7d8a1 cp_parser_decltype_expr /home/vegard/git/gcc/gcc/cp/parser.c:14052 0xf7d8a1 cp_parser_decltype /home/vegard/git/gcc/gcc/cp/parser.c:14126 $ xgcc --version xgcc (GCC) 8.0.1 20180301 (experimental) Built from git c435a9e730c6e8f10da09d58b4fc9aaeb401b0d5 (r258097). Seems present on 4.9.0 if you pass -std=c++14. Test case was minimised by C-Reduce.
Confirmed.
ICEs starting with r208426, before that we rejected it with: pr84661.C:3:36: error: expected primary-expression before ‘auto’ void foo (decltype(((a = 0) || ((auto))))); ^ pr84661.C:3:36: error: expected ‘)’ before ‘auto’ pr84661.C:3:45: error: expected ‘)’ before ‘;’ token void foo (decltype(((a = 0) || ((auto))))); ^ pr84661.C:3:45: error: expected ‘)’ before ‘;’ token pr84661.C:3:45: error: expected ‘)’ before ‘;’ token pr84661.C:3:13: error: expected identifier before ‘decltype’ void foo (decltype(((a = 0) || ((auto))))); ^ pr84661.C:3:36: error: expected primary-expression before ‘auto’ void foo (decltype(((a = 0) || ((auto))))); ^ pr84661.C:3:36: error: expected ‘)’ before ‘auto’ pr84661.C:3:45: error: expected ‘)’ before ‘;’ token void foo (decltype(((a = 0) || ((auto))))); ^ pr84661.C:3:45: error: expected ‘)’ before ‘;’ token pr84661.C:3:45: error: expected ‘)’ before ‘;’ token pr84661.C:3:13: error: expected ‘,’ or ‘...’ before ‘decltype’ void foo (decltype(((a = 0) || ((auto))))); ^ I guess this is a dup of PR84642 and PR84647 though.
Slightly cleaned up testcase, so that it isn't that invalid: struct S { int &a; void foo (decltype(((a = 0) || ((auto))))); };
GCC 6 branch is being closed
Mine.
Author: paolo Date: Mon Mar 25 20:43:36 2019 New Revision: 269923 URL: https://gcc.gnu.org/viewcvs?rev=269923&root=gcc&view=rev Log: /cp 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84661 PR c++/85013 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold to undo the disabling of warnings. /testsuite 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84661 PR c++/85013 * g++.dg/concepts/pr84661.C: New. * g++.dg/torture/pr85013.C: Likewise. Added: trunk/gcc/testsuite/g++.dg/concepts/pr84661.C trunk/gcc/testsuite/g++.dg/torture/pr85013.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Fixed in trunk so far.
The GCC 7 branch is being closed, re-targeting to GCC 8.4.
GCC 8.4.0 has been released, adjusting target milestone.
The GCC 8 branch is being closed, fixed in GCC 9.1.