[Bug c++/96331] Class template argument deduction (CTAD) with Concepts

2022-03-09 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96331

Patrick Palka  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED
 CC||ppalka at gcc dot gnu.org

--- Comment #5 from Patrick Palka  ---
This appears to be a dup of PR93083 which is fixed for GCC >= 10.3.

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

[Bug c++/96331] Class template argument deduction (CTAD) with Concepts

2020-10-28 Thread pilarlatiesa at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96331

Pilar Latiesa  changed:

   What|Removed |Added

 CC||pilarlatiesa at gmail dot com

--- Comment #4 from Pilar Latiesa  ---
Another testcase, taken from
https://stackoverflow.com/questions/64567607/why-is-there-an-error-no-matching-function-for-call-to-aa-auto

template 
struct A {};

template 
struct B {};

template 
struct is_B {};

template 
struct is_B> {}; // error

template 
using B_t = B; // error

[Bug c++/96331] Class template argument deduction (CTAD) with Concepts

2020-10-02 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96331

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|INVALID |---
 Status|RESOLVED|NEW
 Ever confirmed|0   |1
   Last reconfirmed||2020-10-02
   Keywords||rejects-valid

--- Comment #3 from Jonathan Wakely  ---
Reopening then, thanks, Tim.

[Bug c++/96331] Class template argument deduction (CTAD) with Concepts

2020-07-29 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96331

TC  changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #2 from TC  ---
(In reply to Jonathan Wakely from comment #1)
> (In reply to Nicole from comment #0)
> > template
> 
> This is not valid. fixed_string is a class template, not a type and not a
> concept. So you can't use it as a template parameter.
> 
> I don't think this is a bug.

It is a placeholder for a deduced class type, which is allowed by
[temp.param]/6.3.

The example can be reduced drastically:

template
struct S { };

template
concept C = true;

static_assert(C{}>); // OK

template
void f() requires C { // error
}

:11:19: error: class template argument deduction failed:

   11 | void f() requires C {

  |   ^~~~

:11:19: error: no matching function for call to 'S(S<...auto...>)'

:2:8: note: candidate: 'template S()-> S'

2 | struct S {

  |^

:2:8: note:   template argument deduction/substitution failed:

:11:19: note:   candidate expects 0 arguments, 1 provided

   11 | void f() requires C {

  |   ^~~~

:2:8: note: candidate: 'template S(S)-> S'

2 | struct S {

  |^

:2:8: note:   template argument deduction/substitution failed:

:11:19: note:   mismatched types 'S' and 'S<...auto...>'

   11 | void f() requires C {

  |   ^~~~

Compiler returned: 1

[Bug c++/96331] Class template argument deduction (CTAD) with Concepts

2020-07-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96331

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Jonathan Wakely  ---
(In reply to Nicole from comment #0)
> template

This is not valid. fixed_string is a class template, not a type and not a
concept. So you can't use it as a template parameter.

I don't think this is a bug.