public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nickhuang99 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/102033] New: template function signature incorrectly drops top-level cv-qualifiers causing template specialization failing to match
Date: Tue, 24 Aug 2021 09:25:38 +0000	[thread overview]
Message-ID: <bug-102033-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 102033
           Summary: template function signature incorrectly drops
                    top-level cv-qualifiers causing template
                    specialization failing to match
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

The following snippet code fails with similar reason as PR101402, but it cannot
be fixed with similar way of using *resolve_typename_type* without further
improvement of itself.

template<class TA>
struct A{
        template<class TB>
        using Type=TB[3];
};
template<class TA, class TB>
void f(const typename A<TA>::template Type<TB>){}
template <>
void f<int, char>(const typename A<int>::template Type<char>){}


error: template-id 'f<int, char>' for 'void f(const char*)' does not match any
template declaration
    9 | void f<int, char>(const typename A<int>::template Type<char>){}
      |      ^~~~~~~~~~~~
array-using.cpp:7:6: note: candidate is: 'template<class TA, class TB> void
f(typename A<TA>::Type<TB>)'
    7 | void f(const typename A<TA>::template Type<TB>){}
      |      ^

             reply	other threads:[~2021-08-24  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24  9:25 nickhuang99 at hotmail dot com [this message]
2021-08-24  9:33 ` [Bug c++/102033] " pinskia at gcc dot gnu.org
2021-08-24  9:42 ` pinskia at gcc dot gnu.org
2021-08-24 10:12 ` nickhuang99 at hotmail dot com
2021-08-24 11:28 ` redi at gcc dot gnu.org
2021-08-24 13:39 ` redi at gcc dot gnu.org
2021-08-24 15:29 ` redi at gcc dot gnu.org
2021-10-15 21:00 ` cvs-commit at gcc dot gnu.org
2021-10-25  9:02 ` nickhuang99 at hotmail dot com
2021-12-09  4:45 ` pinskia 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-102033-4@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).