https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117219

            Bug ID: 117219
           Summary: strict aliasing documentation maybe should mention
                    C++20's std::bitcast
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: documentation
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Type%2Dpunning

Has an example of how to do type punning using unions but for C++20, the
recommened way is to use std::bit_cast
(https://en.cppreference.com/w/cpp/numeric/bit_cast).

Reply via email to