[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2020-02-05 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Jason Merrill  ---
Fixed.

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2020-02-05 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:fa0c6e297b22d5883857d0db4a6a8be0967cb16f

commit r10-6457-gfa0c6e297b22d5883857d0db4a6a8be0967cb16f
Author: Jason Merrill 
Date:   Tue Feb 4 18:49:16 2020 -0500

c++: Fix SEGV with malformed constructor decl.

In the testcase, since there's no declaration of T, ref_view(T) declares a
non-static data member T of type ref_view, the same type as its enclosing
class.  Then when we try to do C++20 aggregate class template argument
deduction we recursively try to adjust the braced-init-list to match the
template class definition until we run out of stack.

Fixed by rejecting the template data member.

PR c++/92593
* decl.c (grokdeclarator): Reject field of current class type even
in a template.

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2020-02-04 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2020-01-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

--- Comment #4 from Paolo Carlini  ---
Another testcase:

template
struct ref_view
{
  ref_view(T) { };
};

ref_view r{1};

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2020-01-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

Richard Biener  changed:

   What|Removed |Added

   Keywords||error-recovery
   Priority|P3  |P4

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2019-11-20 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-11-20
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Marek Polacek  ---
Confirmed.

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2019-11-20 Thread andrew.n.sutton at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

Andrew Sutton  changed:

   What|Removed |Added

 CC||andrew.n.sutton at gmail dot 
com

--- Comment #2 from Andrew Sutton  ---
It looks like the deduction isn't failing appropriately. The compiler things
the declaration of r has type "ref_view<>", which is
apparently causing infinite recursion in a call to reshape_init_class.

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2019-11-20 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

[Bug c++/92593] [10 Regression] ICE with CTAD using undeclared constraint

2019-11-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92593

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||needs-bisection
  Known to work||9.2.1
Summary|ICE with CTAD using |[10 Regression] ICE with
   |undeclared constraint   |CTAD using undeclared
   ||constraint
  Known to fail||10.0

--- Comment #1 from Jonathan Wakely  ---
With GCC 9 and -std=gnu++2a -fconcepts there's no ICE:

ice.cc:1:10: error: 'integral' has not been declared
1 | template  // oops, should be std::integral
  |  ^~~~
ice.cc:4:11: warning: unnecessary parentheses in declaration of 'T'
[-Wparentheses]
4 |   ref_view(T) { }
  |   ^
ice.cc:4:17: error: expected ';' at end of member declaration
4 |   ref_view(T) { }
  | ^
  |  ;
ice.cc:7:13: error: class template argument deduction failed:
7 | ref_view r{1};
  | ^
ice.cc:7:13: error: no matching function for call to 'ref_view(int)'
ice.cc:2:8: note: candidate: 'template< >
ref_view(ref_view< >)-> ref_view< >'
2 | struct ref_view
  |^~~~
ice.cc:2:8: note:   template argument deduction/substitution failed: