[c++-concepts] Check function concept definitions

Jason Merrill jason@redhat.com
Mon Sep 29 16:32:00 GMT 2014


On 09/29/2014 11:46 AM, Andrew Sutton wrote:
> The main reason for the restriction is that concept definitions are
> normalized into a single constraint-expression. And it's not obvious
> how things like using declarations and static-assertions should be
> interpreted within the constraint language.

A using-declaration just affects name lookup.  They and typedefs/aliases 
can help to make the return statement easier to write.

> That said, having a static_assert inside a concept kind of defeats the
> purpose since it triggers a diagnostic when its condition isn't
> satisfied. That's not very SFINAE friendly :)

True. It might still be useful if for some reason testing a concept for 
a certain class of types indicates an error somewhere else.  And people 
are likely to try it, as indicated by the bug report.  :)

> Maybe the restriction can relaxed when we consider the TS for adoption in 17.

I suppose, but I'd prefer not to wait that long.  I guess we can talk 
about it on the call today.

Jason



More information about the Gcc-patches mailing list