[Bug c++/77790] [5/6/7 Regression] ICE on valid C++14 code when compiling with "-std=c++11": in push_access_scope, at cp/pt.c:227

2017-02-11 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77790

--- Comment #6 from Jason Merrill  ---
Author: jason
Date: Sat Feb 11 17:29:45 2017
New Revision: 245358

URL: https://gcc.gnu.org/viewcvs?rev=245358=gcc=rev
Log:
PR c++/77790 - ICE with auto function in C++11 mode

* decl.c (undeduced_auto_decl): Remove C++14 limitation.
(require_deduced_type): Add complain parm, return bool.
* cp-tree.h: Adjust.
* decl2.c (mark_used): Use require_deduced_type.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/auto-fn35.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/decl2.c
trunk/gcc/testsuite/g++.dg/cpp0x/auto41.C

[Bug c++/77790] [5/6/7 Regression] ICE on valid C++14 code when compiling with "-std=c++11": in push_access_scope, at cp/pt.c:227

2017-02-10 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77790

Jason Merrill  changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |error-recovery
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

--- Comment #5 from Jason Merrill  ---
It's error-recovery.

[Bug c++/77790] [5/6/7 Regression] ICE on valid C++14 code when compiling with "-std=c++11": in push_access_scope, at cp/pt.c:227

2017-02-10 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77790

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #4 from Martin Sebor  ---
Prior to r185768 GCC in C++ 11 mode rejected auto functions without trailing
return type.  With r185768 GCC would accept it with a warning (enabled by
default).  r207055 changed the pedantic warning into an error.  In light of
this, should this bug be viewed as ice-on-invalid-code (error-recovery)?  Or is
it ice-on-valid because it broke in GCC 5 where the code was accepted in C++ 11
mode with just a warning?

[Bug c++/77790] [5/6/7 Regression] ICE on valid C++14 code when compiling with "-std=c++11": in push_access_scope, at cp/pt.c:227

2017-01-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77790

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
The ICE with -std=c++11 is now a bit different:

$ ./cc1plus -quiet e.cc -std=c++11
e.cc:4:44: error: ‘f’ function uses ‘auto’ type specifier without trailing
return type
 template < typename T > static auto f () { return 0; }
^
e.cc:4:44: note: deduced return type only available with -std=c++14 or
-std=gnu++14
e.cc: In substitution of ‘template int A::g() [with U =
]’:
e.cc:8:26:   required from here
e.cc:8:26: internal compiler error: Segmentation fault
 auto a = A < int > {}.g ();
  ^
0xfcdf4e crash_signal
/home/marek/src/gcc/gcc/toplev.c:333
0x7867a5 check_instantiated_arg
/home/marek/src/gcc/gcc/cp/pt.c:17837
0x786d01 check_instantiated_args
/home/marek/src/gcc/gcc/cp/pt.c:17909
0x7c5326 instantiate_template_1
/home/marek/src/gcc/gcc/cp/pt.c:18009
0x7c5326 instantiate_template(tree_node*, tree_node*, int)
/home/marek/src/gcc/gcc/cp/pt.c:18113
0x7caf35 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
/home/marek/src/gcc/gcc/cp/pt.c:18493
0x72caff add_template_candidate_real
/home/marek/src/gcc/gcc/cp/call.c:3164
0x72d87c add_template_candidate
/home/marek/src/gcc/gcc/cp/call.c:3246
0x72d87c add_candidates
/home/marek/src/gcc/gcc/cp/call.c:5481
0x72e25f build_new_method_call_1
/home/marek/src/gcc/gcc/cp/call.c:8656
0x72e25f build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
/home/marek/src/gcc/gcc/cp/call.c:8856
0x84c01b cp_parser_postfix_expression
/home/marek/src/gcc/gcc/cp/parser.c:6989
0x849954 cp_parser_unary_expression
/home/marek/src/gcc/gcc/cp/parser.c:8100
0x853e87 cp_parser_cast_expression
/home/marek/src/gcc/gcc/cp/parser.c:8777
0x85441d cp_parser_binary_expression
/home/marek/src/gcc/gcc/cp/parser.c:8878
0x854ce0 cp_parser_assignment_expression
/home/marek/src/gcc/gcc/cp/parser.c:9165
0x8550f7 cp_parser_constant_expression
/home/marek/src/gcc/gcc/cp/parser.c:9435
0x8558e4 cp_parser_initializer_clause
/home/marek/src/gcc/gcc/cp/parser.c:21543
0x8572d3 cp_parser_initializer
/home/marek/src/gcc/gcc/cp/parser.c:21483
0x866996 cp_parser_init_declarator
/home/marek/src/gcc/gcc/cp/parser.c:19329
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/77790] [5/6/7 Regression] ICE on valid C++14 code when compiling with "-std=c++11": in push_access_scope, at cp/pt.c:227

2016-12-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77790

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/77790] [5/6/7 Regression] ICE on valid C++14 code when compiling with "-std=c++11": in push_access_scope, at cp/pt.c:227

2016-10-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77790

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
   Target Milestone|--- |5.5
Summary|ICE on valid C++14 code |[5/6/7 Regression] ICE on
   |when compiling with |valid C++14 code when
   |"-std=c++11": in|compiling with
   |push_access_scope, at   |"-std=c++11": in
   |cp/pt.c:227 |push_access_scope, at
   ||cp/pt.c:227

--- Comment #2 from Jakub Jelinek  ---
Started with I think r198099 (r198096 with -std=c++0x just warns, r198101
already ICEs).