[Bug c++/96531] [10/11 Regression] ICE for concepts here.

2020-10-07 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96531

Patrick Palka  changed:

   What|Removed |Added

 CC||src at andyf dot de

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

[Bug c++/96531] [10/11 Regression] ICE for concepts here.

2020-09-19 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96531

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

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

commit r11-3296-ge5d72c840a226fdbab65912f97d42a1dbdaf6ed2
Author: Patrick Palka 
Date:   Sat Sep 19 11:02:46 2020 -0400

c++: Fix self-mapping in map_arguments [PR96531, PR97103]

With r10-8077 we stopped passing the argified current_template_parms to
normalize_constraint_expression from finish_nested_requirement, and
instead made map_arguments perform a self-mapping of parameters when
args is NULL.  But we're currently not handling parameter packs and
BOUND_TEMPLATE_TEMPLATE_PARMs properly during this self-mapping, which
leads to ICEs later during satisfaction.

To properly handle self-mapping of a parameter pack, this patch
extends template_parm_to_arg to handle TEMPLATE_PARM_P nodes, and
makes map_arguments use it.  (This change revealed that the call to
template_parm_to_arg in convert_generic_types_to_packs was a no-op
because the argument 't' is never a TREE_LIST, so this patch
additionally removes this call.)

As for bound ttps, map_arguments before r10-8077 would map a
BOUND_TEMPLATE_TEMPLATE_PARM not to itself but to its underlying
TEMPLATE_TEMPLATE_PARM.  We could restore this behavior in
map_arguments, but since a bound ttp is not really a template parameter
it seems better to make keep_template_parm not give us a bound ttp in
the first place.  So this patch makes keep_template_parm return the
underlying ttp when it sees a bound ttp.

gcc/cp/ChangeLog:

PR c++/96531
PR c++/97103
* constraint.cc (map_arguments): Call template_parm_to_arg
in the self-mapping case.
(finish_shorthand_constraint): No need to build a TREE_LIST
before calling template_parm_to_arg.
* pt.c (template_parm_to_arg): Rewrite to handle TEMPLATE_PARM_P
nodes as well as DECL_TEMPLATE_PARM_P nodes, and to make the
overlying TREE_LIST node optional.
(keep_template_parm): Don't record a BOUND_TEMPLATE_TEMPLATE_PARM,
instead record its corresponding TEMPLATE_TEMPLATE_PARM.
(convert_generic_types_to_packs): Don't call
template_parm_to_arg.

gcc/testsuite/ChangeLog:

PR c++/96531
PR c++/97103
* g++.dg/cpp2a/concepts-ttp2.C: New test.
* g++.dg/cpp2a/concepts-variadic1.C: New test.

[Bug c++/96531] [10/11 Regression] ICE for concepts here.

2020-09-18 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96531

Patrick Palka  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

[Bug c++/96531] [10/11 Regression] ICE for concepts here.

2020-08-12 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96531

Patrick Palka  changed:

   What|Removed |Added

  Known to fail||10.1.0, 10.2.0, 11.0
   Keywords||ice-on-valid-code
   Last reconfirmed||2020-08-12
 Status|UNCONFIRMED |NEW
Summary|ICE for concepts here.  |[10/11 Regression] ICE for
   ||concepts here.
 Ever confirmed|0   |1
   Target Milestone|--- |10.3
  Known to work||9.1.0, 9.2.0, 9.3.0
 CC||nathan at acm dot org,
   ||ppalka at gcc dot gnu.org

--- Comment #1 from Patrick Palka  ---
Confirmed.  Here's a reduced valid testcase which exhibits a regression:

template
constexpr bool is_bool = false;

template<>
constexpr bool is_bool = true;

template 
concept C = requires {
requires (is_bool || ...);
};

template  requires C
void bar() {}

int main() {
bar();
}

GCC 9.1-9.3 accept this testcase with -std=c++2a -fconcepts, and GCC 10.1, 10.2
and trunk do not (by way of ICE).

It looks like we began ICEing here starting with r10-8077.