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++/100592] Bogus "qualifiers cannot be applied" error with reference type produced by dependent alias template Date: Thu, 03 Jun 2021 13:39:51 +0000 [thread overview] Message-ID: <bug-100592-4-15JAVTiKf0@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100592-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100592 --- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:d999d9b7e53b9a9cd2004a19e84c637e5e5013f5 commit r12-1183-gd999d9b7e53b9a9cd2004a19e84c637e5e5013f5 Author: Patrick Palka <ppalka@redhat.com> Date: Thu Jun 3 09:39:13 2021 -0400 c++: cv-qualified dependent name of alias tmpl [PR100592] Here, the dependent template name in the return type of f() resolves to an alias of int& after substitution, and we end up complaining about qualifying this reference type with 'const' from cp_build_qualified_type rather than just silently dropping the qualification as per [dcl.ref]/1. The problem is ultimately that make_typename_type ignores the tf_keep_type_decl flag when the dependent name is a template-id. This in turn causes the TYPE_DECL check within tsubst <case TYPENAME_TYPE> to fail, and so we end up not passing tf_ignore_bad_quals to cp_build_qualified_type. This patch fixes this by making make_typename_type respect the tf_keep_type_decl flag in this situation. PR c++/100592 gcc/cp/ChangeLog: * decl.c (make_typename_type): After calling lookup_template_class, adjust the result to its TYPE_NAME and then consider the tf_keep_type_decl flag. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/alias-decl-71.C: New test.
next prev parent reply other threads:[~2021-06-03 13:39 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-14 0:22 [Bug c++/100592] New: " rs2740 at gmail dot com 2021-05-14 7:19 ` [Bug c++/100592] " marxin at gcc dot gnu.org 2021-06-02 16:16 ` ppalka at gcc dot gnu.org 2021-06-03 13:39 ` cvs-commit at gcc dot gnu.org [this message] 2021-11-07 0:27 ` ppalka 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-100592-4-15JAVTiKf0@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: linkBe 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).