[Bug c++/92102] identical requires-expression not subsumed

2020-06-10 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92102

Jonathan Wakely  changed:

   What|Removed |Added

 CC||godeffroy.valet at m4x dot org

--- Comment #3 from Jonathan Wakely  ---
*** Bug 95626 has been marked as a duplicate of this bug. ***

[Bug c++/92102] identical requires-expression not subsumed

2019-11-04 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92102

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jason at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #2 from Jason Merrill  ---
In C++20, atomic constraints are only equivalent if they come from the same
lexical tokens.  So yes, you need to add a concept.

[Bug c++/92102] identical requires-expression not subsumed

2019-10-15 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92102

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-10-15
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
Reduced:


template
  concept nope = false;

template
  concept sure_thing = true;

template
  struct category
  { };

template requires (!nope)
  struct category
  { };

template requires (!nope) && sure_thing
  struct category
  { using type = T; };

category::type t;



ambig.cc:19:14: error: ambiguous template instantiation for 'struct
category'
   19 | category::type t;
  |  ^~
ambig.cc:12:10: note: candidates are: 'template  requires !(nope)
struct category [with T = int]'
   12 |   struct category
  |  ^~~
ambig.cc:16:10: note: 'template  requires !(nope)
&& (sure_thing) struct category [with T = int]'
   16 |   struct category
  |  ^~~
ambig.cc:19:16: error: invalid use of incomplete type 'struct category'
   19 | category::type t;
  |^~~~
ambig.cc:8:10: note: declaration of 'struct category'
8 |   struct category
  |  ^~~~


To make subsumption of (!E) work I need to add a concept for !E


template
  concept nope_nope = !nope;


and then use that:


template requires nope_nope
  struct category
  { };

template requires nope_nope && sure_thing
  struct category
  { using type = T; };