+2020-01-06 Jason Merrill <jason@redhat.com>
+
+ PR c++/92552 - ICE with inherited constrained default ctor.
+ * pt.c (instantiate_class_template_1): Copy
+ TYPE_HAS_USER_CONSTRUCTOR.
+ * class.c (one_inherited_ctor): Don't set it here.
+
2020-01-06 Andrew Sutton <asutton@lock3software.com>
PR c++/92739 - parsing requires clause with attributes.
ctor = implicitly_declare_fn (sfk_inheriting_constructor,
t, /*const*/false, ctor, parms);
add_method (t, ctor, using_decl != NULL_TREE);
- TYPE_HAS_USER_CONSTRUCTOR (t) = true;
return;
}
SET_TYPE_ALIGN (type, TYPE_ALIGN (pattern));
TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (pattern);
CLASSTYPE_NON_AGGREGATE (type) = CLASSTYPE_NON_AGGREGATE (pattern);
+ TYPE_HAS_USER_CONSTRUCTOR (type) = TYPE_HAS_USER_CONSTRUCTOR (pattern);
if (ANON_AGGR_TYPE_P (pattern))
SET_ANON_AGGR_TYPE_P (type);
if (CLASSTYPE_VISIBILITY_SPECIFIED (pattern))
};
template<typename T>
- struct S2 : S1<T> { // { dg-error "no matching function" }
+ struct S2 : S1<T> {
using S1<T>::S1; // { dg-error "no matching function" }
};
int main() {
S2<X> s1(0); // { dg-error "use of deleted function" }
- S2<X> s2; // { dg-error "use of deleted function" }
+ S2<X> s2; // { dg-error "no matching function" }
}
};
template<typename T>
- struct S2 : S1<T> { // { dg-error "matching" }
+ struct S2 : S1<T> {
using S1<T>::S1;
};
int main() {
- S2<int> s; // { dg-error "deleted function" }
+ S2<int> s; // { dg-error "no matching function" }
}
--- /dev/null
+// PR c++/92552
+// { dg-do compile { target concepts } }
+
+template <typename T> struct basic_mixin {
+ basic_mixin() requires true;
+};
+template <typename Cur>
+struct mixin : basic_mixin<Cur> {
+ using basic_mixin<Cur>::basic_mixin;
+};
+int main() {
+ (void)__is_constructible(mixin<int>);
+ // noexcept(mixin<int>()); also triggers ICE
+}
template <typename> A(typename A::X) {} // { dg-error "incomplete" }
};
-// We currently don't give the "no match" error because we don't add the
-// invalid constructor template to TYPE_METHODS.
-A<void> a; // { dg-message "required" }
+A<void> a; // { dg-message "no match" }
void f ()
{
- Test<void> c; // { dg-message "required" }
+ Test<void> c; // { dg-error "no match" }
}