public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101687] New: Scoped enumerators of a member enumeration shall not be referred by a class member access expression
@ 2021-07-30 8:45 xmh970252187 at gmail dot com
2021-08-05 10:12 ` [Bug c++/101687] " pinskia at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: xmh970252187 at gmail dot com @ 2021-07-30 8:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101687
Bug ID: 101687
Summary: Scoped enumerators of a member enumeration shall not
be referred by a class member access expression
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: xmh970252187 at gmail dot com
Target Milestone: ---
struct A{
enum class C{
a = 0
};
};
int main(){
A a;
auto c = a.C::a; //#1
}
> Each enum-name and each unscoped enumerator is declared in the scope that immediately contains the enum-specifier.
> An enumerator declared in class scope can be referred to using the class member access operators (::, . (dot) and -> (arrow)), see [expr.ref].
According to the above rule, A::C::a shouldn't appear in the id-expression of a
member access expression, which means `#1` should be ill-formed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101687] Scoped enumerators of a member enumeration shall not be referred by a class member access expression
2021-07-30 8:45 [Bug c++/101687] New: Scoped enumerators of a member enumeration shall not be referred by a class member access expression xmh970252187 at gmail dot com
@ 2021-08-05 10:12 ` pinskia at gcc dot gnu.org
2022-12-29 2:24 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05 10:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101687
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-08-05
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
GCC 4.7.4 used to ICE on this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101687] Scoped enumerators of a member enumeration shall not be referred by a class member access expression
2021-07-30 8:45 [Bug c++/101687] New: Scoped enumerators of a member enumeration shall not be referred by a class member access expression xmh970252187 at gmail dot com
2021-08-05 10:12 ` [Bug c++/101687] " pinskia at gcc dot gnu.org
@ 2022-12-29 2:24 ` pinskia at gcc dot gnu.org
2023-01-10 5:44 ` xmh970252187 at gmail dot com
2023-01-10 5:48 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-29 2:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101687
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm, MSVC also accepts this code but clang does not.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101687] Scoped enumerators of a member enumeration shall not be referred by a class member access expression
2021-07-30 8:45 [Bug c++/101687] New: Scoped enumerators of a member enumeration shall not be referred by a class member access expression xmh970252187 at gmail dot com
2021-08-05 10:12 ` [Bug c++/101687] " pinskia at gcc dot gnu.org
2022-12-29 2:24 ` pinskia at gcc dot gnu.org
@ 2023-01-10 5:44 ` xmh970252187 at gmail dot com
2023-01-10 5:48 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: xmh970252187 at gmail dot com @ 2023-01-10 5:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101687
--- Comment #3 from jim x <xmh970252187 at gmail dot com> ---
I think CWG2557 is clear with this aspect
https://cplusplus.github.io/CWG/issues/2557.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/101687] Scoped enumerators of a member enumeration shall not be referred by a class member access expression
2021-07-30 8:45 [Bug c++/101687] New: Scoped enumerators of a member enumeration shall not be referred by a class member access expression xmh970252187 at gmail dot com
` (2 preceding siblings ...)
2023-01-10 5:44 ` xmh970252187 at gmail dot com
@ 2023-01-10 5:48 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-10 5:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101687
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |SUSPENDED
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Suspending as the defect report is still considered open but is in the process
of drafting:
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2557
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-01-10 5:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 8:45 [Bug c++/101687] New: Scoped enumerators of a member enumeration shall not be referred by a class member access expression xmh970252187 at gmail dot com
2021-08-05 10:12 ` [Bug c++/101687] " pinskia at gcc dot gnu.org
2022-12-29 2:24 ` pinskia at gcc dot gnu.org
2023-01-10 5:44 ` xmh970252187 at gmail dot com
2023-01-10 5:48 ` 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).