[Bug c++/109683] [13/14 Regression] False cyclic dependency error reported for constraint

2023-07-27 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109683

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|13.2|13.3

--- Comment #3 from Richard Biener  ---
GCC 13.2 is being released, retargeting bugs to GCC 13.3.

[Bug c++/109683] [13/14 Regression] False cyclic dependency error reported for constraint

2023-05-01 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109683

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/109683] [13/14 Regression] False cyclic dependency error reported for constraint

2023-05-01 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109683

Patrick Palka  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=105797
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
   Last reconfirmed||2023-05-01
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Keywords||rejects-valid
   Target Milestone|--- |13.2
 CC||ppalka at gcc dot gnu.org

--- Comment #2 from Patrick Palka  ---
Thanks for the bug report.  Started with r13-980-gdf4f95dbd4764f which made
function parameters used in a constraint no longer induce a dependency on all
contextual template parameters.

So another workaround would be to make the constructor's constraints explicitly
depend on the second template parameter of the class:

template 
struct VariantConstructors {
  VariantConstructors(T&& t)
requires(requires { T(t); typename U; });
};

...

[Bug c++/109683] [13/14 Regression] False cyclic dependency error reported for constraint

2023-05-01 Thread ali.mpfard at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109683

Ali Mohammad Pur Fard  changed:

   What|Removed |Added

 CC||ali.mpfard at gmail dot com

--- Comment #1 from Ali Mohammad Pur Fard  ---
As a note, using a type alias for `T` in the constraint seems to work around
the issue:
```
template 
struct VariantConstructors {
  using U = T;
  VariantConstructors(T&& t)
requires(requires { U(t); });
};

// Everything below is the same as the repro case

template 
struct InheritFromEntries : Ts... {};

template 
struct InheritFromPack: InheritFromEntries... {
  using InheritFromEntries::InheritFromEntries...;
};

template 
struct Variant : InheritFromPack>...>
{};

template 
class Outer;
struct Inner {
Inner(Outer);
};
template
class Outer {
Variant value_;
};

struct Empty {};
void fn(Outer x) {}
```

(https://godbolt.org/z/1GTrjcvG6)