[Bug c++/67070] [concepts] Concept with negation and disjunction not checked correctly
andrew.n.sutton at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Jul 31 18:17:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67070
--- Comment #2 from Andrew Sutton <andrew.n.sutton at gmail dot com> ---
> This is a very subtle point. It seems to me that it would be better if
> creating the normal form of a constaint stops substituting into concept bodies
> once it's clear that we're inside an atomic constraint. So f would have a
> single atomic predicate constraint
>
> !A<T>
>
> and then when we consider this later we try to satisfy A<B>, which fails, so
> f's constraint is satisfied and the testcase succeeds. Though this does create
> an inconsistency in argument substitution behavior across the ! operator, which
> might be confusing.
>
> Any thoughts, Andrew?
I had a bug report filed against that behavior earlier this year (note
Bugzilla, just an outside email). If you stop substituting through
atomic constraints, then requirements in e..g, A<T> would not be
substituted in the immediate context. Basically, it makes any concepts
behind a ! not SFINAE friendly.
If we had a rule that allowed the evaluation of a concept in any
context, then we could avoid doing this. It would also guarantee the
ability to write;
static_assert(C<T>);
This is probably a good issue to raise against the TS, and we should
discuss it in Kona.
Andrew
More information about the Gcc-bugs
mailing list