]> git.ipfire.org Git - thirdparty/gcc.git/commit
doc: type-punning through a union is a GNU extension for C++
authorSam James <sam@gentoo.org>
Thu, 9 Oct 2025 02:40:58 +0000 (03:40 +0100)
committerSam James <sam@gentoo.org>
Thu, 9 Oct 2025 03:11:48 +0000 (04:11 +0100)
commitb52a90e7a03fef3c237a78c91dcad37237338d1b
tree1c89f49bc21e91d4c5f680154b9f0736365fd661
parent24ba6f2f96340f98d0d84b60c5f6bb1141500b03
doc: type-punning through a union is a GNU extension for C++

We didn't explicitly say that type-punning through a union is undefined
behavior in C++. Mention that, and that we support it as a GNU extension.

This was reported on LLVM's Discourse (forums) [0].

[0] https://discourse.llvm.org/t/ub-when-type-punning-through-unions/88527/6

gcc/ChangeLog:
PR c++/117219

* doc/invoke.texi (-fstrict-aliasing): Explain that type-punning
through a union in C++ is supported as a GNU extension.
gcc/doc/invoke.texi