erichkeane wrote:

> > Is it more reasonable to have the bodies of the functions that matter start 
> > with a `static_assert` on the completeness of the type?
> 
> That would basically be the other option: Add a `static_assert(sizeof(_Tp) >= 
> 0)` to every single function. That's much less ergonomic and significantly 
> more error-prone though (and also has worse diagnostic messages). We'll 
> probably do that if you don't want to take the attribute. For the library 
> it'd be much nicer not having to do that though.

Hmm.. I was thinking more of `static_assert(__is_complete_type(_Tp))` with a 
reasonable message.  But I see that might be effectively a clang-only builtin 
type trait(as it is for embarcadero compat?!).

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

Reply via email to