serge-sans-paille wrote:

My initial motivation is based on `memset` requiring trivially copyable types 
[according to cpp 
reference](https://en.cppreference.com/w/cpp/string/byte/memset), and 
admittedly GCC's behavior.

I tried to dig into the standard for backing arguments, but failed to do so in 
a clear way, so let's move forward, as I acknowledge the argument of idiomatic 
code. But I don't want to miss cases where a sub-object has a non trivial 
default constructor as in https://godbolt.org/z/aq7PosMPa.

I can see the practical aspect of only requiring:

1. trivially default constructible type when from outside of the constructor
2. that the type matches all requirements for being default constructible 
except the requirement of a defaulted default constructor, when from the 
default constructor.

What do you think of that approach?


https://github.com/llvm/llvm-project/pull/170577
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to