2020-04-21 Patrick Palka <ppalka@redhat.com>
+ PR c++/94549
+ * constraint.cc (satisfy_declaration_constraints): Don't strip the
+ inherited constructor if it already has template information.
+
PR c++/94597
* pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
is a conversion operator, visit its TREE_TYPE.
{
gcc_assert (DECL_P (t));
- /* For inherited constructors, consider the original declaration;
- it has the correct template information attached. */
- if (flag_new_inheriting_ctors)
+ if (!DECL_TEMPLATE_INFO (t))
+ /* For inherited constructors without template information, consider
+ the original declaration; it has the correct template information
+ attached. */
t = strip_inheriting_ctors (t);
/* Update the declaration for diagnostics. */
+2020-04-21 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/94549
+ * g++.dg/concepts/inherit-ctor3.C: Adjust expected diagnostics.
+ * g++.dg/cpp2a/concepts-inherit-ctor4.C: New test.
+ * g++.dg/cpp2a/concepts-inherit-ctor8.C: New test.
+
2020-04-21 Jonathan Wakely <jwakely@redhat.com>
PR c++/94149
template<typename T>
struct S2 : S1<T> { // { dg-error "no matching function" }
- using S1<T>::S1; // { dg-error "no matching function" }
+ using S1<T>::S1;
};
struct X { } x;
int main() {
- S2<X> s1(0); // { dg-error "use of deleted function" }
+ S2<X> s1(0); // { dg-error "no matching function" }
S2<X> s2; // { dg-error "use of deleted function" }
}
template<typename T>
struct S2 : S1<T> {
- using S1<T>::S1; // { dg-error "no matching function" }
+ using S1<T>::S1;
};
int main() {
- S2<int> s(0); // { dg-error "use of deleted function" }
+ S2<int> s(0); // { dg-error "no matching function" }
}
--- /dev/null
+// PR c++/94549
+// { dg-do compile { target concepts } }
+
+struct base {
+ template <typename type>
+ requires false
+ base(type);
+
+ template <typename type>
+ requires true
+ base(type);
+};
+
+struct derived : base {
+ using base::base;
+};
+
+void foo() {
+ derived{'G'};
+}