public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111872] New: GCC rejects out of class definition of inner private class template
@ 2023-10-19 5:40 jlame646 at gmail dot com
2023-10-19 16:44 ` [Bug c++/111872] " ppalka at gcc dot gnu.org
2024-04-04 6:22 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: jlame646 at gmail dot com @ 2023-10-19 5:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111872
Bug ID: 111872
Summary: GCC rejects out of class definition of inner private
class template
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
The following valid(afaik) code is rejected by gcc but accepted by clang and
msvc.
https://godbolt.org/z/x5xMvETPh
```
class A {
struct N;
template<const N* K> struct S;
};
// works now
class A::N{};
template<const A::N* K> class A::S{};//gcc rejects this but clang and msbc
accepts this
```
GCC says:
<source>:10:19: error: 'class A::N' is private within this context
10 | template<const A::N* K> class A::S{};//gcc rejects this but clang and
msbc accepts this
| ^
<source>:9:10: note: declared private here
9 | class A::N{};
| ^
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/111872] GCC rejects out of class definition of inner private class template
2023-10-19 5:40 [Bug c++/111872] New: GCC rejects out of class definition of inner private class template jlame646 at gmail dot com
@ 2023-10-19 16:44 ` ppalka at gcc dot gnu.org
2024-04-04 6:22 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-10-19 16:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111872
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-10-19
Ever confirmed|0 |1
--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Confirmed, this is similar to the example in
http://eel.is/c++draft/class.access.general#example-3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/111872] GCC rejects out of class definition of inner private class template
2023-10-19 5:40 [Bug c++/111872] New: GCC rejects out of class definition of inner private class template jlame646 at gmail dot com
2023-10-19 16:44 ` [Bug c++/111872] " ppalka at gcc dot gnu.org
@ 2024-04-04 6:22 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-04 6:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111872
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|NEW |RESOLVED
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 56248.
*** This bug has been marked as a duplicate of bug 56248 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-04 6:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 5:40 [Bug c++/111872] New: GCC rejects out of class definition of inner private class template jlame646 at gmail dot com
2023-10-19 16:44 ` [Bug c++/111872] " ppalka at gcc dot gnu.org
2024-04-04 6:22 ` pinskia at gcc dot gnu.org
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).