public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102468] New: False acceptance of invalid `using Parent::Grandparent`
@ 2021-09-23 11:38 fchelnokov at gmail dot com
2021-10-26 7:57 ` [Bug c++/102468] " pinskia at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: fchelnokov at gmail dot com @ 2021-09-23 11:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102468
Bug ID: 102468
Summary: False acceptance of invalid `using
Parent::Grandparent`
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
This code is invalid due-to specific `using` line, but GCC erroneously accepts
it:
```
struct A {};
struct B : A {};
struct C : B {
using B::A; //???
};
```
There shall be an error printed (as MSVC does)
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/102468] False acceptance of invalid `using Parent::Grandparent`
2021-09-23 11:38 [Bug c++/102468] New: False acceptance of invalid `using Parent::Grandparent` fchelnokov at gmail dot com
@ 2021-10-26 7:57 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-26 7:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102468
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=62240,
| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=11764,
| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=56090
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is not a GCC bug but rather a bug in MSVC. Note both ICC and Clang accept
it.
Parent::Grandparent names the type, not the constructor. This is unlike
name::name.
See DR 147 also:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#147
I think MSVC does not inject the base class name correctly.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-26 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 11:38 [Bug c++/102468] New: False acceptance of invalid `using Parent::Grandparent` fchelnokov at gmail dot com
2021-10-26 7:57 ` [Bug c++/102468] " 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).