As far as I understand, the following program should work in C++20 mode:
#include <vector>
struct B{ int a0, a1; };
int main()
{
std::vector<B> bs;
bs.emplace_back( 0, 0 );
}
And it really does in Visual Studio 2019 and gcc 11. But not in clang 12, which produces the error:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/alloc_traits.h:514:4: error: no matching function for call to 'construct_at'
std::construct_at(__p, std::forward<_Args>(__args)...);
^~~~~~~~~~~~~~~~~
In online compiler: https://gcc.godbolt.org/z/GzccTWc5z
Is this because clang does not fully support C++20 yet?