Re: [C++ PATCH] Disallow reinterpret_cast in potential_constant_expression_1 (PR c++/89599)

2019-03-07 Thread Jason Merrill
On 3/7/19 2:29 PM, Jakub Jelinek wrote: Hi! The last testcase in the patch diagnoses invalid constexpr in the ptr case, but doesn't for arr. The array is constexpr, so we do: value = fold_non_dependent_expr (value); if (DECL_DECLARED_CONSTEXPR_P (decl) ||

[C++ PATCH] Disallow reinterpret_cast in potential_constant_expression_1 (PR c++/89599)

2019-03-07 Thread Jakub Jelinek
Hi! The last testcase in the patch diagnoses invalid constexpr in the ptr case, but doesn't for arr. The array is constexpr, so we do: value = fold_non_dependent_expr (value); if (DECL_DECLARED_CONSTEXPR_P (decl) || (DECL_IN_AGGR_P (decl) &&