blob: 2fdf4e8f89f097f41f232acb8a336bee00b10f3a [file] [log] [blame]
// Test that non-aggregates don't get the aggregate deduction.
// { dg-do compile { target c++20 } }
// { dg-prune-output "no matching function" }
struct A { A(); };
template <typename T>
struct S1 {
T x;
};
S1 s1 = {1}; // OK
template <typename T>
struct S2 {
S2 ();
T x;
};
S2 s2 = {1}; // { dg-error "deduction failed" }
template <typename T>
struct S3 {
private:
T x;
};
S3 s3 = {1}; // { dg-error "deduction failed" }
template <typename T>
struct S4 {
virtual void f();
T x;
};
S4 s4 = {1}; // { dg-error "deduction failed" }
template <typename T>
struct S5: public A {
using A::A;
T x;
};
S5 s5 = {1}; // { dg-error "deduction failed" }
template <typename T>
struct S6: virtual A {
T x;
};
S6 s6 = {1}; // { dg-error "deduction failed" }