aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorliuke <liuke.gehry@bytedance.com>2021-09-24 13:14:09 -0400
committerAaron Ballman <aaron@aaronballman.com>2021-09-24 13:15:21 -0400
commite4902480f1e2f12f73c2b504e3d717536653dd7b (patch)
tree2ef38a19490f48d476ac260206037a29a2c7b5f7 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent8dd42ffc09e30b1bf936f5da1aa104916e50d2fa (diff)
downloadllvm-e4902480f1e2f12f73c2b504e3d717536653dd7b.zip
llvm-e4902480f1e2f12f73c2b504e3d717536653dd7b.tar.gz
llvm-e4902480f1e2f12f73c2b504e3d717536653dd7b.tar.bz2
Fix wrong FixIt about union in cppcoreguidelines-pro-type-member-init
At most one variant member of a union may have a default member initializer. The case of anonymous records with multiple levels of nesting like the following also needs to meet this rule. The original logic is to horizontally obtain all the member variables in a record that need to be initialized and then filter to the variables that need to be fixed. Obviously, it is impossible to correctly initialize the desired variables according to the nesting relationship. See Example 3 in class.union union U { U() {} int x; // int x{}; union { int k; // int k{}; <== wrong fix }; union { int z; // int z{}; <== wrong fix int y; }; };
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions