[Bug c++/109181] requires expression type requirement rejects valid type when it is a nested member template

2023-08-09 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181

Patrick Palka  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #7 from Patrick Palka  ---
(In reply to waffl3x from comment #6)
> PR 110927 presents a similar use case that originally lead me to this bug, I
> also posted the workarounds that I had since discovered there. If anyone
> coming across this bug is looking for a solution you can find them there.

Interesting, thanks!  I'm going to call this PR a dup of the newer one then,
since that one has your workarounds.

*** This bug has been marked as a duplicate of bug 110927 ***

[Bug c++/109181] requires expression type requirement rejects valid type when it is a nested member template

2023-08-07 Thread waffl3x at protonmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181

--- Comment #6 from waffl3x  ---
PR 110927 presents a similar use case that originally lead me to this bug, I
also posted the workarounds that I had since discovered there. If anyone coming
across this bug is looking for a solution you can find them there.

[Bug c++/109181] requires expression type requirement rejects valid type when it is a nested member template

2023-03-21 Thread waffl3x at protonmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181

--- Comment #5 from waffl3x  ---
(In reply to Patrick Palka from comment #3)
> A workaround is to just remove the unneeded 'template' after the :: in this
> case.  Or is there an example where the template keyword is needed that we
> incorrectly reject?

In my original use case, A in `inline constexpr bool go = requires{typename
A::template B;};` would have been dependent, I included the template
keyword because of that but it should have occurred to me that the example I
presented doesn't need it, I'm not sure what the standard requires for this
sort of thing though.

When I reduce I just remove everything that isn't required to get the result
I'm looking for, I should have realized that changing the semantics of the
example might create confusion and in the future I think I will also include a
reduced version that comes closer to the problem I actually encountered, I
imagine that it will be helpful even if it's not actually the most reduced
version.

I'll try to create an example that reflects my use case better as soon as I
can.

[Bug c++/109181] requires expression type requirement rejects valid type when it is a nested member template

2023-03-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181

--- Comment #4 from Andrew Pinski  ---
(In reply to Patrick Palka from comment #3)
> A workaround is to just remove the unneeded 'template' after the :: in this
> case.  Or is there an example where the template keyword is needed that we
> incorrectly reject?

I could not find an example.

I did find an example where the template is removed clang rejects it but gcc
does not:
struct A {
template
using B = int;
};
template
T C();

template
bool go = requires{typename decltype(C())::template B;};

bool a = go;

[Bug c++/109181] requires expression type requirement rejects valid type when it is a nested member template

2023-03-20 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181

Patrick Palka  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org

--- Comment #3 from Patrick Palka  ---
A workaround is to just remove the unneeded 'template' after the :: in this
case.  Or is there an example where the template keyword is needed that we
incorrectly reject?

[Bug c++/109181] requires expression type requirement rejects valid type when it is a nested member template

2023-03-18 Thread waffl3x at protonmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181

--- Comment #2 from waffl3x  ---
(In reply to Andrew Pinski from comment #1)
> Confirmed.
> Goes away the way back when -fconcepts support was originally added in GCC
> 6. You can see that with this testcase:
> ```
> struct A {
> template
> using B = int;
> };
> 
> template
> bool go = requires{typename A::template B;};
> ```
> 
> Note back in GCC 6, you needed `-std=c++17 -fconcepts` and also requires was
> only allowed for templates too ..

Ah damn, I'll try to keep in mind that I can use the old enabling flags to go
further back. I'm glad this one wasn't a duplicate, heres hoping I don't find
another bug today

[Bug c++/109181] requires expression type requirement rejects valid type when it is a nested member template

2023-03-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109181

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2023-03-18
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
  Known to fail||10.1.0, 12.1.0, 13.0,
   ||6.1.0, 7.1.0

--- Comment #1 from Andrew Pinski  ---
Confirmed.
Goes away the way back when -fconcepts support was originally added in GCC 6.
You can see that with this testcase:
```
struct A {
template
using B = int;
};

template
bool go = requires{typename A::template B;};
```

Note back in GCC 6, you needed `-std=c++17 -fconcepts` and also requires was
only allowed for templates too ..