In the following code example, I perform a value initialization of a std::vector of incomplete type.
#include <vector>
struct B;
struct A {
std::vector<B> _;
};
A a{}; // <--here
struct B {};
https://godbolt.org/z/ab5Erqc1n
This runs afoul of the second half of https://eel.is/c++draft/vector#overview-4. "T shall be complete before any member of the resulting specialization of vector is referenced." I do not know if this is ill-formed or undefined behavior.
Staring in clang-15, this is diagnosed as invalid, but only with -std=c++20. Thisimplies to me that this diagnostic is probably incidental. For consistency it would be helpful if this diagnostic could be emitted for all standard versions, as a Quality of Implementation improvement.
As a reference I have added https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108669 to normalize this diagnostic across clang and gcc.