[Bug c++/71965] [6/7 regression] [concepts] Substitution error *after* failure to satisfy an earlier constraint

andrew.n.sutton at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 20 01:45:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71965

--- Comment #5 from Andrew Sutton <andrew.n.sutton at gmail dot com> ---
Hmm... I haven't looked at this in a while. It looks like the expansion of
ConstructibleObject<int[2][2], int[2][2]> is triggering the diagnostic. I'm a
little surprised that this gets diagnosed -- especially with a "sorry". But it
still shouldn't happen.

The implementation (I suspect this comes out of satisfy_check_constraint)
appears to be substituting through too aggressively. It expands the concept
using the instantiated arguments, the pair of int[2][2]s, around
constraint.cc:2056. I'm guessing that that ultimately triggers a substitution
of those arguments into the requirements of the requires-expression. Bang!
error.

One solution would be to make expand_concept() simply return the definition and
then decompose that expression, substituting when needed.


More information about the Gcc-bugs mailing list