2020-04-29 Patrick Palka <ppalka@redhat.com>
+ PR c++/94819
+ * constraint.cc (satisfy_declaration_constraints): Use saved_t
+ instead of t as the key to decl_satisfied_cache.
+
PR c++/94808
* error.c (print_requires_expression_info): Print the dependent
form of the parameter list with its template parameter mapping,
info.in_decl = t;
if (info.quiet ())
- if (tree *result = hash_map_safe_get (decl_satisfied_cache, t))
+ if (tree *result = hash_map_safe_get (decl_satisfied_cache, saved_t))
return *result;
/* Get the normalized constraints. */
}
if (info.quiet ())
- hash_map_safe_put<hm_ggc> (decl_satisfied_cache, t, result);
+ hash_map_safe_put<hm_ggc> (decl_satisfied_cache, saved_t, result);
return result;
}
2020-04-29 Patrick Palka <ppalka@redhat.com>
+ PR c++/94819
+ * g++.dg/cpp2a/concepts-inherit-ctor10.C: New test.
+ * g++.dg/cpp2a/concepts-inherit-ctor11.C: New test.
+
PR c++/94808
* g++.dg/concepts/diagnostic12.C: New test.
* g++.dg/concepts/diagnostic5.C: Adjust dg-message.
--- /dev/null
+// PR c++/94819
+// { dg-do compile { target concepts } }
+
+struct dna4 {};
+struct rna4 {};
+
+struct alphabet_tuple_base {
+ template <typename component_type>
+ requires __is_same(component_type, rna4)
+ alphabet_tuple_base(component_type) {}
+};
+
+struct structured_rna : alphabet_tuple_base {
+ using alphabet_tuple_base::alphabet_tuple_base;
+};
+
+structured_rna t2{dna4{}}; // { dg-error "no match" }
+structured_rna t3{rna4{}}; // { dg-bogus "no match" }
--- /dev/null
+// PR c++/94819
+// { dg-do compile { target concepts } }
+
+struct dna4 {};
+struct rna4 {};
+
+template <typename component_types>
+struct alphabet_tuple_base {
+ template <typename component_type>
+ requires __is_same(component_type, component_types)
+ alphabet_tuple_base(component_type) {}
+};
+
+template <typename sequence_alphabet_t>
+struct structured_rna : alphabet_tuple_base<sequence_alphabet_t> {
+ using base_type = alphabet_tuple_base<sequence_alphabet_t>;
+ using base_type::base_type;
+};
+
+structured_rna<rna4> t2{dna4{}}; // { dg-error "no match" }
+structured_rna<rna4> t3{rna4{}}; // { dg-bogus "no match" }