[clang] [libcxx] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 24 13:05:54 PDT 2024
================
@@ -670,6 +670,8 @@ namespace MemcpyEtc {
constexpr bool test_address_of_incomplete_struct_type() { // expected-error {{never produces a constant}}
struct Incomplete;
extern Incomplete x, y;
+ // expected-warning at +2 {{destination for call to '__builtin_memcpy' is a pointer to non-trivially copyable type 'Incomplete'}}
----------------
carlosgalvezp wrote:
"destination for call" sounds a bit strange to me when reading. I'd write "destination argument/parameter for call"
But we are splitting hairs at this point, if everyone else are happy with the current message I'm ok.
https://github.com/llvm/llvm-project/pull/111434
More information about the cfe-commits
mailing list