This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts
- From: Jason Merrill <jason at redhat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, Nathan Sidwell <nathan at acm dot org>
- Date: Mon, 2 Apr 2018 21:15:36 -0400
- Subject: Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts
- References: <orh8p6pop0.fsf@lxoliva.fsfla.org> <CADzB+2kBWkqzhNW+GDpt1WrQ463Db0JOCF+EAhE9b+W7j59Ebg@mail.gmail.com> <or605gin7q.fsf@lxoliva.fsfla.org> <CADzB+2mSn8oa98R6p90BTfn3gS_0qDc-MW3Pb4R7J9G21TEe9w@mail.gmail.com> <ory3iay0y5.fsf@lxoliva.fsfla.org> <CADzB+2m-R7KQrgV3AV4XUn2x3T9u2QBgbN-pqck+R6LimTudJw@mail.gmail.com> <or8ta8zmaf.fsf@lxoliva.fsfla.org>
On Sat, Mar 31, 2018 at 4:23 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Mar 30, 2018, Jason Merrill <jason@redhat.com> wrote:
>
>> True, it looks like sometimes we build a TEMPLATE_ID_EXPR with an
>> IDENTIFIER_NODE. Looking at tsubst_copy_and_build, I see that we
>> don't call finish_id_expression when substituting such a
>> TEMPLATE_ID_EXPR. So maybe lookup_template_function and
>> lookup_template_variable are the right places for this test.
>
> Nevermind the earlier email about multiple errors. I realized that we
> save the preparsed template_id right after the tests in
> cp_parser_template_id, and if only I don't stop the rejected template
> from being saved, we avoid the duplicate errors, as in the patch below.
>
> A slight variant of this passed regstrap on i686- and x86_64-linux-gnu.
> Ok to install, though it does not catch such cases as:
>
> template <typename T>
> void foo(T t) {
> typename T::template C<auto> u = t;
> T::template C<auto> (t);
> T::template C<auto>::f (t, u);
> }
>
> ?
We should be able to distinguish those cases based on tag_type.
Jason