https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114076

--- Comment #2 from Jiang An <de34 at live dot cn> ---
The "templatization" trick also works for GCC.

https://godbolt.org/z/8PeMMzsbb

```
template <typename T>
struct holder {
    holder() = default;

    constexpr ~holder() {
        static_assert(sizeof(T) || true);
    }
};

struct Incomplete;

template<class = void> // templated
struct Class {
    Class();
    ~Class();

    holder<Incomplete> a{};                      // all accept
    holder<Incomplete> b = {};                   // all accept
    holder<Incomplete> c = holder<Incomplete>{}; // only Clang rejects
};

int main() {
    [[maybe_unused]] Class v; // CTAD
}
```

It's unclear to me what is not yet instantiated after the object definition.

Reply via email to