Re: [PATCH] c++: Further simplify the stdlib inline folding

2025-05-16 Thread Jason Merrill
On 5/15/25 4:58 PM, Ville Voutilainen wrote: On Thu, 15 May 2025 at 18:32, Ville Voutilainen wrote: On Thu, 15 May 2025 at 18:19, Jason Merrill wrote: @@ -3347,8 +3347,6 @@ cp_fold (tree x, fold_flags_t flags) || id_equal (DECL_NAME (callee), "as_const"))) {

Re: [PATCH] c++: Further simplify the stdlib inline folding

2025-05-15 Thread Ville Voutilainen
On Thu, 15 May 2025 at 18:32, Ville Voutilainen wrote: > > On Thu, 15 May 2025 at 18:19, Jason Merrill wrote: > > > > @@ -3347,8 +3347,6 @@ cp_fold (tree x, fold_flags_t flags) > > > || id_equal (DECL_NAME (callee), "as_const"))) > > > { > > > r = CALL_EXPR_ARG (x,

Re: [PATCH] c++: Further simplify the stdlib inline folding

2025-05-15 Thread Jason Merrill
On 5/15/25 10:36 AM, Ville Voutilainen wrote: This is a follow-up to the earlier patch that adds std::to_underlying to the set of stdlib functions that are folded. We don't seem to need to handle the same-type case specially, the folding will just do the right thing. Also fix up the mistake of n

Re: [PATCH] c++: Further simplify the stdlib inline folding

2025-05-15 Thread Ville Voutilainen
On Thu, 15 May 2025 at 18:19, Jason Merrill wrote: > > @@ -3347,8 +3347,6 @@ cp_fold (tree x, fold_flags_t flags) > > || id_equal (DECL_NAME (callee), "as_const"))) > > { > > r = CALL_EXPR_ARG (x, 0); > > - if (!same_type_p (TREE_TYPE (x), TREE_TYPE (r))) >

[PATCH] c++: Further simplify the stdlib inline folding

2025-05-15 Thread Ville Voutilainen
This is a follow-up to the earlier patch that adds std::to_underlying to the set of stdlib functions that are folded. We don't seem to need to handle the same-type case specially, the folding will just do the right thing. Also fix up the mistake of not tweaking the cmdline switch doc in the earlie