[Bug c++/104111] Concept evaluation depends on context where it was first checked

2022-05-27 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104111

--- Comment #6 from Jason Merrill  ---
(In reply to Jason Merrill from comment #5)
> An alternative fix for this bug would be to include the evaluation context
> in the satisfaction cache.

...if the evaluation involved access checking of a private or protected member.

[Bug c++/104111] Concept evaluation depends on context where it was first checked

2022-05-27 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104111

Jason Merrill  changed:

   What|Removed |Added

 Blocks||67491

--- Comment #5 from Jason Merrill  ---
(In reply to Patrick Palka from comment #3)
> > because concept-id evaluation shall not depend on the context.
> 
> One consequence of making this change to concept-id evaluation would be that
> for:
> 
>   template void f() requires (!C);
> 
> during constraint checking for say f(), we no longer evaluate C
> (as part of evaluation of the atomic constraint !C) in the access context
> of f, which seems surprising to me.
> 
> CC'ing Jason for guidance.

This issue was discussed on the CWG mailing list back in 2018, but seems never
to have made it to the issues list.  There was general agreement at the time
that access should be checked in the lexical context of the atomic constraint,
as with other expressions; this does indeed have the consequence that you
mention.  Which means that since we don't have class-scope concepts, any
constraints that need to depend on access control need to be written directly
in the requires-clause rather than through a concept.  Or just give up on
trying to express constraints that depend on access.

An alternative fix for this bug would be to include the evaluation context in
the satisfaction cache.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues

[Bug c++/104111] Concept evaluation depends on context where it was first checked

2022-04-21 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104111

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|11.3|11.4

--- Comment #4 from Richard Biener  ---
GCC 11.3 is being released, retargeting bugs to GCC 11.4.

[Bug c++/104111] Concept evaluation depends on context where it was first checked

2022-01-21 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104111

Patrick Palka  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #3 from Patrick Palka  ---
> because concept-id evaluation shall not depend on the context.

One consequence of making this change to concept-id evaluation would be that
for:

  template void f() requires (!C);

during constraint checking for say f(), we no longer evaluate C (as
part of evaluation of the atomic constraint !C) in the access context of f,
which seems surprising to me.

CC'ing Jason for guidance.

[Bug c++/104111] Concept evaluation depends on context where it was first checked

2022-01-19 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104111

Patrick Palka  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Target Milestone|--- |11.3
 CC||ppalka at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org

[Bug c++/104111] Concept evaluation depends on context where it was first checked

2022-01-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104111

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2022-01-19
 Status|UNCONFIRMED |NEW

--- Comment #2 from Andrew Pinski  ---
Confirmed.

[Bug c++/104111] Concept evaluation depends on context where it was first checked

2022-01-19 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104111

--- Comment #1 from Fedor Chelnokov  ---
Sorry, related discussion: https://stackoverflow.com/q/53263299/7325599