[clang-tools-extra] [clang-tidy] Fix bugprone-tagged-union-member-count false-positive (PR #135831)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 12 16:51:12 PDT 2025


=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/135831 at github.com>


================
@@ -9,6 +9,9 @@ different from the number of data members inside the union.
 A struct or a class is considered to be a tagged union if it has
 exactly one union data member and exactly one enum data member and
 any number of other data members that are neither unions or enums.
+The union and enum data members that are from system header files or
+the ``std`` namespace are not considered to make up the tagged union part
+of a user-defined tagged union type.
----------------
5chmidti wrote:

Maybe `Union and enum data members that are from system header files or
the ``std`` namespace are not considered to be the union member or tagging enum member respectively of a user-defined tagged union type.`

https://github.com/llvm/llvm-project/pull/135831


More information about the cfe-commits mailing list