[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2021-12-30 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840

--- Comment #5 from Johel Ernesto Guerrero Peña  ---
I think I was wrong and this has not regressed.

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2021-12-30 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840

--- Comment #4 from Johel Ernesto Guerrero Peña  ---
Seems like this regressed. Do I open a new bug report?

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2021-02-01 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840

Patrick Palka  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|WAITING |RESOLVED

--- Comment #3 from Patrick Palka  ---
With the above patch we now detect and diagnose the self-recursive satisfaction
in the testcase:

96840.C: In substitution of ‘template  requires  C void
operator*(T, Int) [with T = int]’:
96840.C:1:64:   required by substitution of ‘template  requires  C void operator*(Int, T) [with T = int]’
96840.C:6:28:   required from here
96840.C:1:37:   required for the satisfaction of ‘C’ [with T =
Int; Rep = int]
96840.C:1:41:   in requirements with ‘T t’, ‘U u’ [with U = int; T = Int]
96840.C:1:41: error: satisfaction of atomic constraint ‘requires(T t, U u) {t *
 u;} [with U = Rep; T = T]’ depends on itself
1 | template  concept C = requires(T t, U u) { t * u; };
  | ^

So I suppose we can mark this PR as resolved.

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2020-12-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:79f57d5cb070bb02ea0a34b5f42658d6659b19a8

commit r11-6245-g79f57d5cb070bb02ea0a34b5f42658d6659b19a8
Author: Patrick Palka 
Date:   Thu Dec 17 22:18:07 2020 -0500

c++: Diagnose self-recursive satisfaction

This patch further extends the satisfaction_cache class to diagnose
self-recursive satisfaction.

gcc/cp/ChangeLog:

* constraint.cc (sat_entry::evaluating): New member.
(satisfaction_cache::get): If entry->evaluating, diagnose
self-recursive satisfaction.  Otherwise, set entry->evaluating
if we're not reusing a cached satisfaction result.
(satisfaction_cache::save): Clear entry->evaluating.
(satisfy_atom): Set up diagnosing_failed_constraint before the
first call to get().

gcc/testsuite/ChangeLog:

PR c++/96840
* g++.dg/cpp2a/concepts-pr88395.C: Adjust to expect the
self-recursive satisfaction to get directly diagnosed.
* g++.dg/cpp2a/concepts-recursive-sat2.C: Likewise.
* g++.dg/cpp2a/concepts-recursive-sat4.C: New test.

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2020-10-16 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
 Ever confirmed|0   |1
   Last reconfirmed||2020-10-16

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2020-09-28 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840

Patrick Palka  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org

--- Comment #1 from Patrick Palka  ---
Started with r11-2774:

c++: Check satisfaction before non-dep convs. [CWG2369]

It's very hard to use concepts to protect a template from hard errors due
to
unwanted instantiation if constraints aren't checked until after doing all
substitution and checking of non-dependent conversions.

We fall into a loop when checking the constraints of the second overload
(instantiated with Rep=int and T=Int).

It looks like we're correct to reject the testcase as of this DR?

[Bug c++/96840] [11 Regression] Recursive substitution in constrained commutative operator

2020-08-31 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96840

Richard Biener  changed:

   What|Removed |Added

   Keywords||rejects-valid
   Target Milestone|--- |11.0
Summary|Recursive substitution in   |[11 Regression] Recursive
   |constrained commutative |substitution in constrained
   |operator|commutative operator