efriedma-quic wrote:

>So I think this supports the notion that this should be a dialect, and we have 
>to wire defaults differently in MSVC mode as well.

I doubt anyone is intentionally depending on equality here.

> C++ does have some restrictions on accessing objects that are being 
> initialized through other names. It's possible that they're strong enough to 
> satisfy the ABI rule here through a sort of reverse of the normal analysis: 
> basically, any program that would violate the ABI rule is actually incorrect 
> because of the semantic restriction. If not, I think we may need to force 
> copies of trivial return types in the caller in C++. We can consider that 
> separately, though.

I suspect it isn't legal to actually access the object through another pointer 
while it's being constructed, but that doesn't help if the user is just doing a 
pointer equality comparison.  And C++17 rules forbid a copy on the caller side: 
"guaranteed copy elision" means semantically, there is no copy.

https://github.com/llvm/llvm-project/pull/101038
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to