2019-01-17 Alexandre Oliva <aoliva@redhat.com>
+ PR c++/86648
+ * pt.c (make_template_placeholder): Use auto_identifier.
+ (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
+ * error.c (dump_type): Handle template placeholders.
+ * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
+
PR c++/88146
* cvt.c (convert_to_void): Handle all cdtor calls as if
returning void.
case TEMPLATE_TYPE_PARM:
case TEMPLATE_TEMPLATE_PARM:
- if (TYPE_IDENTIFIER (t))
+ if (template_placeholder_p (t))
+ {
+ t = TREE_TYPE (CLASS_PLACEHOLDER_TEMPLATE (t));
+ pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t));
+ pp_string (pp, "<...auto...>");
+ }
+ else if (TYPE_IDENTIFIER (t))
pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t));
else
pp_cxx_canonical_template_parameter (pp, t);
pp_cxx_cv_qualifier_seq (pp, t);
if (tree c = PLACEHOLDER_TYPE_CONSTRAINTS (t))
pp_cxx_constrained_type_spec (pp, c);
+ else if (template_placeholder_p (t))
+ {
+ t = TREE_TYPE (CLASS_PLACEHOLDER_TEMPLATE (t));
+ pp_cxx_tree_identifier (pp, TYPE_IDENTIFIER (t));
+ pp_string (pp, "<...auto...>");
+ }
else if (TYPE_IDENTIFIER (t))
pp_cxx_tree_identifier (pp, TYPE_IDENTIFIER (t));
else
tree
make_template_placeholder (tree tmpl)
{
- tree t = make_auto_1 (DECL_NAME (tmpl), true);
+ tree t = make_auto_1 (auto_identifier, true);
CLASS_PLACEHOLDER_TEMPLATE (t) = tmpl;
return t;
}
{
if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
&& (TYPE_IDENTIFIER (type) == auto_identifier
- || TYPE_IDENTIFIER (type) == decltype_auto_identifier
- || CLASS_PLACEHOLDER_TEMPLATE (type)))
+ || TYPE_IDENTIFIER (type) == decltype_auto_identifier))
return true;
else
return false;
+2019-01-17 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/86648
+ * gcc.dg/cpp1z/pr86648.C: New.
+
2019-01-17 Kewen Lin <linkw@gcc.gnu.org>
PR target/87306
--- /dev/null
+// { dg-do compile { target c++17 } }
+
+template <typename> class A;
+template <class T> struct B { static A a{T::a}; };
+void foo () { B<int> a; }