public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58661] New: Definition of inherited nested class should be invalid
@ 2013-10-08 4:32 zeratul976 at hotmail dot com
2013-10-08 8:49 ` [Bug c++/58661] " redi at gcc dot gnu.org
2024-06-05 0:54 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: zeratul976 at hotmail dot com @ 2013-10-08 4:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58661
Bug ID: 58661
Summary: Definition of inherited nested class should be invalid
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zeratul976 at hotmail dot com
GCC accepts the following code without any errors:
struct A
{
struct nested;
};
struct B : public A {};
struct B::nested {};
I believe that this code is invalid according to [class] p11:
"If a class-head-name contains a nested-name-specifier, the class-specifier
shall refer to a class that was previously declared directly in the class or
namespace to which the nested-name-specifier refers, or in an element of the
inline namespace set (7.3.1) of that namespace (i.e., not merely inherited or
introduced by a using-declaration)"
Note that clang rejects the above code, with the error:
test.cpp:8:11: error: no struct named 'nested' in 'B'
struct B::nested {};
~~~^
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/58661] Definition of inherited nested class should be invalid
2013-10-08 4:32 [Bug c++/58661] New: Definition of inherited nested class should be invalid zeratul976 at hotmail dot com
@ 2013-10-08 8:49 ` redi at gcc dot gnu.org
2024-06-05 0:54 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-08 8:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58661
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-10-08
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/58661] Definition of inherited nested class should be invalid
2013-10-08 4:32 [Bug c++/58661] New: Definition of inherited nested class should be invalid zeratul976 at hotmail dot com
2013-10-08 8:49 ` [Bug c++/58661] " redi at gcc dot gnu.org
@ 2024-06-05 0:54 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-05 0:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58661
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Just for reference this was defect #347 which was closed as not a defect due to
other changes (defect report #284)
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#347
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#284
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-05 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-08 4:32 [Bug c++/58661] New: Definition of inherited nested class should be invalid zeratul976 at hotmail dot com
2013-10-08 8:49 ` [Bug c++/58661] " redi at gcc dot gnu.org
2024-06-05 0:54 ` 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).