On Mon, 12 May 2025 at 21:35, Ville Voutilainen <ville.voutilai...@gmail.com> wrote: > > This function is yet another stdlib function that is just a simple > cast, so having > it appear while debugging is arguably not useful. So add it to the > existing handling > that always-folds some stdlib functions. > > Add std::to_underlying to the set of stdlib functions that are always folded > > gcc/cp/ChangeLog: > * cp-gimplify.cc (cp_fold): Add to_underlying. > > gcc/testsuite/ChangeLog: > * g++.dg/opt/pr96780_cpp23.C: New. > > libstdc++/ChangeLog: > * include/std/utility (to_underlying): Add the > __always_inline__ attribute.
Yes, this is just a simple cast like move and forward are. The library part is OK.