Re: [C++ PATCH] Fix ICE in C++14 with null RETURN_EXPR (PR c++/65202)

2015-02-26 Thread Marek Polacek
On Thu, Feb 26, 2015 at 01:26:01PM +0100, Kai Tietz wrote: @@ -2935,7 +2935,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, constexpr_ctx new_ctx; tree r = t; - if (t == error_mark_node) + if (t == NULL_TREE || t == error_mark_node) {

Re: [C++ PATCH] Fix ICE in C++14 with null RETURN_EXPR (PR c++/65202)

2015-02-26 Thread Jason Merrill
On 02/26/2015 07:22 AM, Marek Polacek wrote: - if (t == error_mark_node) + if (t == NULL_TREE || t == error_mark_node) { *non_constant_p = true; No, we don't want an empty return to make the call non-constant, it's perfectly valid. Let's handle this specifically in the

Re: [C++ PATCH] Fix ICE in C++14 with null RETURN_EXPR (PR c++/65202)

2015-02-26 Thread Marek Polacek
On Thu, Feb 26, 2015 at 08:35:00AM -0500, Jason Merrill wrote: On 02/26/2015 07:22 AM, Marek Polacek wrote: - if (t == error_mark_node) + if (t == NULL_TREE || t == error_mark_node) { *non_constant_p = true; No, we don't want an empty return to make the call non-constant,

Re: [C++ PATCH] Fix ICE in C++14 with null RETURN_EXPR (PR c++/65202)

2015-02-26 Thread Jason Merrill
OK, thanks. Jason

[C++ PATCH] Fix ICE in C++14 with null RETURN_EXPR (PR c++/65202)

2015-02-26 Thread Marek Polacek
We ICE on this invalid testcase in C++14 because in C++14 a function returning void is a valid constexpr function, so adl_swap is registered as one, while in C++11 it is not registered. Then later on, we weren't able to properly handle a RETURN_EXPR with null operand when trying to evaluate the

Re: [C++ PATCH] Fix ICE in C++14 with null RETURN_EXPR (PR c++/65202)

2015-02-26 Thread Kai Tietz
Hi Marek, I have similiar change on the c++-delayed-fold branch. 2015-02-26 13:22 GMT+01:00 Marek Polacek pola...@redhat.com: We ICE on this invalid testcase in C++14 because in C++14 a function returning void is a valid constexpr function, so adl_swap is registered as one, while in C++11 it