public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/100918] [10 Regression] Naming a destructor as a qualified template-id results in bogus access error
Date: Thu, 04 May 2023 21:49:18 +0000 [thread overview]
Message-ID: <bug-100918-4-6hfpLhXVSm@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100918-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100918
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #8)
> (In reply to Christian Prochaska from comment #7)
> > Since the commit above the following test fails. Is this correct?
>
> >
> > class T1 { };
> > class T2 { };
> >
> > template <typename T>
> > class A { };
> >
> > class B : A<T1> { };
> >
> > class C : B
> > {
> > class D : A<T2> { };
> > };
> >
> > test.cc:11:19: error: ‘class A<T1> A<T1>::A’ is private within this context
> > 11 | class D : A<T2> { };
> > | ^~~~~
> > test.cc:7:7: note: declared private here
> > 7 | class B : A<T1> { };
> > | ^
>
>
>
> Yes it should be rejected as A is a private name of A<T1> and A<T1> is
> private to B. clang rejects it for the same reason though has a better error
> message:
> <source>:12:19: error: 'A' is a private member of 'A<T1>'
> class D : A<T2> { };
> ^
> <source>:8:11: note: constrained by implicitly private inheritance here
> class B : A<T1> { };
> ^~~~~
> <source>:6:7: note: member is declared here
> class A { };
> ^
An obvious fix is to use ::A<T2> while inside C .
next prev parent reply other threads:[~2023-05-04 21:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 20:22 [Bug c++/100918] New: " ppalka at gcc dot gnu.org
2021-06-04 20:27 ` [Bug c++/100918] " ppalka at gcc dot gnu.org
2021-06-04 20:33 ` ppalka at gcc dot gnu.org
2021-06-04 21:12 ` [Bug c++/100918] [9/10/11/12 Regression] " ppalka at gcc dot gnu.org
2021-06-07 16:06 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:03 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:04 ` [Bug c++/100918] [9/10 " ppalka at gcc dot gnu.org
2022-05-27 9:45 ` [Bug c++/100918] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:45 ` jakub at gcc dot gnu.org
2023-05-04 21:43 ` christian.prochaska@genode-labs.com
2023-05-04 21:46 ` pinskia at gcc dot gnu.org
2023-05-04 21:49 ` pinskia at gcc dot gnu.org [this message]
2023-07-07 9:41 ` rguenth 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-100918-4-6hfpLhXVSm@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).