]> TLD Linux GIT Repositories - packages/gcc.git/blob - pr88419-revert.patch
- release 2
[packages/gcc.git] / pr88419-revert.patch
1 # DP: Revert the fix for PC c++/88419, causing PR c++/89906.
2
3 2019-03-08  Jason Merrill  <jason@redhat.com>
4
5         PR c++/88419 - C++17 ICE with class template arg deduction.
6         * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
7         CLASS_PLACEHOLDER_TEMPLATE.
8
9 --- a/gcc/cp/pt.c
10 +++ b/gcc/cp/pt.c
11 @@ -26002,10 +26002,8 @@
12  tree
13  make_template_placeholder (tree tmpl)
14  {
15 -  tree t = make_auto_1 (DECL_NAME (tmpl), false);
16 +  tree t = make_auto_1 (DECL_NAME (tmpl), true);
17    CLASS_PLACEHOLDER_TEMPLATE (t) = tmpl;
18 -  /* Our canonical type depends on the placeholder.  */
19 -  TYPE_CANONICAL (t) = canonical_type_parameter (t);
20    return t;
21  }
22  
23 --- a/gcc/testsuite/g++.dg/cpp1z/class-deduction62.C
24 +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction62.C
25 @@ -1,22 +0,0 @@
26 -// PR c++/88419
27 -// { dg-do compile { target c++17 } }
28 -
29 -template<class> struct ref_view {
30 -  template<class T> ref_view(T&&);
31 -};
32 -
33 -template<class R> ref_view(R&) -> ref_view<R>;
34 -
35 -struct ref_fn {
36 -  template<class R> auto operator()(R r) const
37 -    noexcept(noexcept(ref_view{r}));
38 -};
39 -
40 -template<class R> struct indirect_view {
41 -  indirect_view(R);
42 -};
43 -
44 -struct indirect_fn {
45 -  template<class R> auto operator()(R r) const
46 -    noexcept(noexcept(indirect_view{r}));
47 -};