public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/94799] [8/9/10 Regression] Calling a member template function fails
Date: Wed, 28 Oct 2020 19:26:43 +0000	[thread overview]
Message-ID: <bug-94799-4-wAdFsXKIxy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94799-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94799

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:323dd4255203479d8c456b85513db4f8e0041d04

commit r11-4499-g323dd4255203479d8c456b85513db4f8e0041d04
Author: Marek Polacek <polacek@redhat.com>
Date:   Mon Oct 19 18:13:42 2020 -0400

    c++: Member template function lookup failure [PR94799]

    My earlier patch for this PR, r11-86, broke pybind11.  That patch
    changed cp_parser_class_name to also consider the object expression
    scope (parser->context->object_type) to fix parsing of

      p->template A<T>::foo(); // consider p's scope too

    Here we reject

      b.operator typename B<T>::type();

    because 'typename_p' in cp_parser_class_name uses 'scope', which means
    that 'typename_p' will be true for the example above.  Then we create
    a TYPENAME_TYPE via make_typename_type, which fails when tsubsting it;
    the code basically created 'typename B::B' and then we complain that there
    is no member named 'B' in 'A<int>'.  So, when deciding if we should
    create a TYPENAME_TYPE, don't consider the object_type scope, like we
    did pre-r11-86.

    gcc/cp/ChangeLog:

            PR c++/94799
            * parser.c (cp_parser_class_name): Use parser->scope when
            setting typename_p.

    gcc/testsuite/ChangeLog:

            PR c++/94799
            * g++.dg/template/lookup16.C: New test.

  parent reply	other threads:[~2020-10-28 19:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 13:57 [Bug c++/94799] New: [7.2+ " ojman101 at protonmail dot com
2020-04-27 15:53 ` [Bug c++/94799] [8/9/10 Regression] " mpolacek at gcc dot gnu.org
2020-04-27 15:58 ` mpolacek at gcc dot gnu.org
2020-04-27 16:34 ` rguenth at gcc dot gnu.org
2020-04-27 19:24 ` [Bug c++/94799] [8/9/10 " mpolacek at gcc dot gnu.org
2020-04-28  0:51 ` mpolacek at gcc dot gnu.org
2020-04-28 23:43 ` mpolacek at gcc dot gnu.org
2020-04-29  4:11 ` mpolacek at gcc dot gnu.org
2020-05-05 14:19 ` [Bug c++/94799] [8/9/10/11 " cvs-commit at gcc dot gnu.org
2020-05-05 14:21 ` [Bug c++/94799] [8/9/10 " mpolacek at gcc dot gnu.org
2020-05-15  9:52 ` reichelt at gcc dot gnu.org
2020-05-15 12:43 ` mpolacek at gcc dot gnu.org
2020-08-17 10:10 ` reichelt at gcc dot gnu.org
2020-08-17 17:32 ` mpolacek at gcc dot gnu.org
2020-10-19 21:03 ` mpolacek at gcc dot gnu.org
2020-10-20  0:53 ` mpolacek at gcc dot gnu.org
2020-10-24 18:25 ` mpolacek at gcc dot gnu.org
2020-10-28 19:26 ` cvs-commit at gcc dot gnu.org [this message]
2020-10-28 19:27 ` mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94799-4-wAdFsXKIxy@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).