On 1/23/19 11:05 AM, Marek Polacek wrote:
Since C++20 P0634R3 we sometimes treat certain qualified-ids as types, so that
the user doesn't have to type 'typename'.  But this was broken for this case:

   template<typename T> T::type N::v(T::value);

which, if T::value is a type, is a function template declaration.  But if
T::value is a value, it's a variable template definition.  So we can't
always assume T::value is a type.

This patch fixes it according to the proposed resolution discussed on the core
reflector (2018-10-29) -- perform name lookup to see if N::v is one or more
function templates, and if it isn't, don't consider 'typename' optional in the
parameter list.

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2019-01-23  Marek Polacek  <pola...@redhat.com>

        PR c++/88757 - qualified name treated wrongly as type.
        * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
        in parameter-list as types if name lookup for declarator-id didn't
        find one or more function templates.

OK.

Jason

Reply via email to