[Bug c++/105842] rejects-valid: static member function overload set constrained by concepts for class template results in ambiguous call

2022-07-27 Thread joeloser at fastmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105842

--- Comment #6 from Joe Loser  ---
(In reply to Patrick Palka from comment #5)
> Fixed for GCC 12.2/13

Thanks for the fix, Patrick!

[Bug c++/105842] rejects-valid: static member function overload set constrained by concepts for class template results in ambiguous call

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

Patrick Palka  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Patrick Palka  ---
Fixed for GCC 12.2/13

[Bug c++/105842] rejects-valid: static member function overload set constrained by concepts for class template results in ambiguous call

2022-07-21 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105842

--- Comment #4 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:5d6286903f325a7a85e5ab1d04ba942d33d755bc

commit r12-8605-g5d6286903f325a7a85e5ab1d04ba942d33d755bc
Author: Patrick Palka 
Date:   Wed Jul 13 14:01:28 2022 -0400

c++: dependence of constrained memfn from current inst [PR105842]

Here we incorrectly deem the calls to func1, func2 and tmpl2 as
ambiguous ahead of time ultimately because we mishandle dependence
of a constrained member function from the current instantiation.

In type_dependent_expression_p, we already consider dependence of a
TEMPLATE_DECL's constraints (via uses_outer_template_parms), but
neglect to do the same for a FUNCTION_DECL (such as that for func1).

And in satisfy_declaration_constraints, we give up if _any_ template
argument is dependent, but for non-dependent member functions from
the current instantiation (such as func2 and tmpl2), we can and must
check constraints as long as the innermost arguments aren't dependent.

PR c++/105842

gcc/cp/ChangeLog:

* constraint.cc (satisfy_declaration_constraints): Refine early
exit test for argument dependence.
* cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
* pt.cc (template_class_depth): Handle TI_TEMPLATE being a
FIELD_DECL.
(usse_outer_template_parms): Factor out constraint dependence
test into ...
(uses_outer_template_parms_in_constraints): ... here.
(type_dependent_expression_p): Use it for FUNCTION_DECL.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-memtmpl6.C: New test.

(cherry picked from commit f07778f6f92111aa0abfd0f669b148a0bda537a9)

[Bug c++/105842] rejects-valid: static member function overload set constrained by concepts for class template results in ambiguous call

2022-07-13 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105842

Patrick Palka  changed:

   What|Removed |Added

   Target Milestone|--- |12.2

[Bug c++/105842] rejects-valid: static member function overload set constrained by concepts for class template results in ambiguous call

2022-07-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105842

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:f07778f6f92111aa0abfd0f669b148a0bda537a9

commit r13-1687-gf07778f6f92111aa0abfd0f669b148a0bda537a9
Author: Patrick Palka 
Date:   Wed Jul 13 14:01:28 2022 -0400

c++: dependence of constrained memfn from current inst [PR105842]

Here we incorrectly deem the calls to func1, func2 and tmpl2 as
ambiguous ahead of time ultimately because we mishandle dependence
of a constrained member function from the current instantiation.

In type_dependent_expression_p, we already consider dependence of a
TEMPLATE_DECL's constraints (via uses_outer_template_parms), but
neglect to do the same for a FUNCTION_DECL (such as that for func1).

And in satisfy_declaration_constraints, we give up if _any_ template
argument is dependent, but for non-dependent member functions from
the current instantiation (such as func2 and tmpl2), we can and must
check constraints as long as the innermost arguments aren't dependent.

PR c++/105842

gcc/cp/ChangeLog:

* constraint.cc (satisfy_declaration_constraints): Refine early
exit test for argument dependence.
* cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
* pt.cc (template_class_depth): Handle TI_TEMPLATE being a
FIELD_DECL.
(usse_outer_template_parms): Factor out constraint dependence
test into ...
(uses_outer_template_parms_in_constraints): ... here.
(type_dependent_expression_p): Use it for FUNCTION_DECL.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-memtmpl6.C: New test.

[Bug c++/105842] rejects-valid: static member function overload set constrained by concepts for class template results in ambiguous call

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

Patrick Palka  changed:

   What|Removed |Added

 CC||jlame646 at gmail dot com

--- Comment #2 from Patrick Palka  ---
*** Bug 106046 has been marked as a duplicate of this bug. ***

[Bug c++/105842] rejects-valid: static member function overload set constrained by concepts for class template results in ambiguous call

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

Patrick Palka  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Keywords||rejects-valid
 CC||ppalka at gcc dot gnu.org
   Last reconfirmed||2022-06-06
  Known to fail||10.3.0, 11.3.0, 12.1.0,
   ||13.0, 9.4.0

--- Comment #1 from Patrick Palka  ---
Confirmed, doesn't seem to be a regression.