+2019-10-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/91930 - ICE with constrained inherited default ctor.
+ * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
+ for inherited constructor.
+
2019-10-14 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (check_tag_decl): Use DECL_SOURCE_LOCATION.
maybe_warn_cpp0x (CPP0X_INHERITING_CTORS);
name = ctor_identifier;
CLASSTYPE_NON_AGGREGATE (current_class_type) = true;
+ TYPE_HAS_USER_CONSTRUCTOR (current_class_type) = true;
}
/* Cannot introduce a constructor name. */
struct B2 {
B2(double) { }
};
-struct D1 : B1 { // { dg-error "no match" }
+struct D1 : B1 {
using B1::B1; // implicitly declares D1(int)
int x;
};
void test() {
D1 d(6); // OK: d.x is not initialized
- D1 e; // { dg-error "deleted" } D1 has no default constructor
+ D1 e; // { dg-error "no match" } D1 has no default constructor
}
struct D2 : B2 {
using B2::B2; // { dg-error "B1::B1" }
int get();
-struct D1 : B1 { // { dg-message "B1::B1" }
+struct D1 : B1 {
using B1::B1; // inherits B1(int, ...)
int x;
int y = get();
D1 d(2, 3, 4); // OK: B1 is initialized by calling B1(2, 3, 4),
// then d.x is default-initialized (no initialization is performed),
// then d.y is initialized by calling get()
- D1 e; // { dg-error "" } D1 has a deleted default constructor
+ D1 e; // { dg-error "" } D1 has no default constructor
}
struct D2 : B2 {
--- /dev/null
+// PR c++/91930
+// { dg-do compile { target c++2a } }
+
+template <typename T> struct basic_mixin {
+ basic_mixin() requires true;
+};
+
+struct mixin : basic_mixin<int> {
+ using basic_mixin<int>::basic_mixin;
+};
+
+mixin m;