This is the mail archive of the
mailing list for the GCC project.
Re: [c++-concepts] Class template constraints
- From: Andrew Sutton <andrew dot n dot sutton at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- Date: Wed, 4 Sep 2013 13:33:10 -0400
- Subject: Re: [c++-concepts] Class template constraints
- Authentication-results: sourceware.org; auth=none
- References: <CANq5SysAD-Dqupb5UVYJWx1c2_Bh2YbHMA86hdvk0J_dvPnPSA at mail dot gmail dot com> <52274F43 dot 5020002 at redhat dot com> <CANq5Syt+5xzFKwGopVsKxcr_S8nLAVgd5RSBdYmWCxOWxwGNNQ at mail dot gmail dot com> <52276B10 dot 9050407 at redhat dot com>
>> It's not supposed to be different. Checking constraints in
>> instantiate_template is actually too late. We want to check before
>> instantiation, at the point of use.
> Right, what I was getting at is that instantiate_template actually only
> instantiates the declaration of a function, not the definition, so it
> corresponds to lookup_template_class for class templates.
Ah. The goal is to check after we've deduced/coerced template
arguments into a valid substitution. With functions, that's in
fn_type_unification (hopefully called from instantiate_template), and
for classes in lookup_template_class.
There are some other places too: get_class_bindings for partial
specializations, and determine_specialization for explicit
> Oh, did the comment just mean that absence is equivalent to absence? I
> thought the comment was saying that absence is considered equivalent to
> anything else. Just tweak the comment, then.