在 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>` is not meant to instantiate `T`. Your code actually compiles fine if the definition of `J` was not provided. -- Best regards, LIU Hao