which compiler is right (either to compile or to barf)...

LIU Hao lh_mouse@126.com
Thu Dec 1 09:35:04 GMT 2022


在 2022/12/1 12:51, leon zadorin via Gcc-help 写道:
> Hi everyone,
> 
> I would be interested to hear the opinions of C++ standard experts on which
> compiler is correctly dealing with the below code (GCC 12.2 -std=c++20
>   compiles fine, MSVC19.33 /std:c++20 compiles fine, Clang 15.0.0 -std=c++20
> barfs)
> 

I think this is a bug in Clang. Instantiation of `shared_ptr<T<U>>` is not meant to instantiate 
`T<U>`. Your code actually compiles fine if the definition of `J` was not provided.

-- 
Best regards,
LIU Hao

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20221201/c2cb382a/attachment.sig>


More information about the Gcc-help mailing list