This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch/RFC] PR 60254


Hi,

in this regression (Jakub figured out that it started with r72165) we ICE during error recovery:

60254_1.C: In function ‘bool foo(T)’:
60254_1.C:4:3: error: non-constant condition for static assertion
static_assert(foo(i), "Error");
^
60254_1.C:4:3: internal compiler error: unexpected expression ‘foo’ of kind overload
0x743e15 cxx_eval_constant_expression
../../trunk/gcc/cp/semantics.c:9790
0x7425b6 cxx_eval_call_expression
../../trunk/gcc/cp/semantics.c:8364
0x743d64 cxx_eval_constant_expression
../../trunk/gcc/cp/semantics.c:9487
0x7471e6 cxx_eval_outermost_constant_expr
../../trunk/gcc/cp/semantics.c:9810
0x74fd0d cxx_constant_value
../../trunk/gcc/cp/semantics.c:9895
0x74fd0d finish_static_assert(tree_node*, tree_node*, unsigned int, bool)
../../trunk/gcc/cp/semantics.c:6863
0x6b770b cp_parser_static_assert
../../trunk/gcc/cp/parser.c:11838

Would it be Ok to trivially handle OVERLOAD for the benefit of error recovery per the attached? The error message we additionally emit makes sense:

60254_1.C:7:22: error: expression ‘foo’ does not designate a constexpr function
static_assert(foo(i), "Error");

Thanks!
Paolo.

PS: the second testcase is already fixed.

Attachment: patch_60254
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]