public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100084] New: using enum lookup isn't type-only
@ 2021-04-14 18:03 barry.revzin at gmail dot com
2021-04-14 18:12 ` [Bug c++/100084] " barry.revzin at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: barry.revzin at gmail dot com @ 2021-04-14 18:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084
Bug ID: 100084
Summary: using enum lookup isn't type-only
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: barry.revzin at gmail dot com
Target Milestone: ---
>From Stack Avarflaw (https://stackoverflow.com/q/67096550/2069064):
namespace A { enum A {}; };
using namespace A;
using enum A;
gcc trunk rejects this lookup as ambiguous, between the namespace A and the
enum A. But our lookup in this context should be type-only, so the namespace A
should not a candidate.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/100084] using enum lookup isn't type-only
2021-04-14 18:03 [Bug c++/100084] New: using enum lookup isn't type-only barry.revzin at gmail dot com
@ 2021-04-14 18:12 ` barry.revzin at gmail dot com
2021-04-14 18:18 ` mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: barry.revzin at gmail dot com @ 2021-04-14 18:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084
--- Comment #1 from Barry Revzin <barry.revzin at gmail dot com> ---
Also gcc accepts:
namespace A { enum A {}; };
using namespace A;
using enum A::A;
Which, apparently, this one should actually be ambiguous.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/100084] using enum lookup isn't type-only
2021-04-14 18:03 [Bug c++/100084] New: using enum lookup isn't type-only barry.revzin at gmail dot com
2021-04-14 18:12 ` [Bug c++/100084] " barry.revzin at gmail dot com
@ 2021-04-14 18:18 ` mpolacek at gcc dot gnu.org
2021-04-15 5:22 ` hewillk at gmail dot com
2021-12-24 21:27 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-14 18:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |mpolacek at gcc dot gnu.org
Keywords| |accepts-invalid,
| |rejects-valid
Last reconfirmed| |2021-04-14
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/100084] using enum lookup isn't type-only
2021-04-14 18:03 [Bug c++/100084] New: using enum lookup isn't type-only barry.revzin at gmail dot com
2021-04-14 18:12 ` [Bug c++/100084] " barry.revzin at gmail dot com
2021-04-14 18:18 ` mpolacek at gcc dot gnu.org
@ 2021-04-15 5:22 ` hewillk at gmail dot com
2021-12-24 21:27 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: hewillk at gmail dot com @ 2021-04-15 5:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084
康桓瑋 <hewillk at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hewillk at gmail dot com
--- Comment #3 from 康桓瑋 <hewillk at gmail dot com> ---
Here is a weird case that I think should be accepted:
enum e { e };
using enum e;
gcc rejects with:
<source>:2:12: error: 'e' is not a type
2 | using enum e;
| ^
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/100084] using enum lookup isn't type-only
2021-04-14 18:03 [Bug c++/100084] New: using enum lookup isn't type-only barry.revzin at gmail dot com
` (2 preceding siblings ...)
2021-04-15 5:22 ` hewillk at gmail dot com
@ 2021-12-24 21:27 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-24 21:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |luizfvalle at pm dot me
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 103824 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-24 21:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 18:03 [Bug c++/100084] New: using enum lookup isn't type-only barry.revzin at gmail dot com
2021-04-14 18:12 ` [Bug c++/100084] " barry.revzin at gmail dot com
2021-04-14 18:18 ` mpolacek at gcc dot gnu.org
2021-04-15 5:22 ` hewillk at gmail dot com
2021-12-24 21:27 ` 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).