This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [PR c++/84979] improve auto handling in explicit tmpl args for concepts


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]