public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94227] New: ambiguous lookup for nested-name-specifier in using-declaration is not diagnosed
@ 2020-03-19 19:50 richard-gccbugzilla at metafoo dot co.uk
2020-03-19 19:58 ` [Bug c++/94227] " mpolacek at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2020-03-19 19:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94227
Bug ID: 94227
Summary: ambiguous lookup for nested-name-specifier in
using-declaration is not diagnosed
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC accepts this invalid code:
namespace N1 {
int &f();
}
namespace N2 {
struct N1 {
float &f();
};
}
using namespace N2;
int &r = N1::f();
This should be rejected due to ambiguity: the name N1 on the final line is
looked up by unqualified lookup, and that lookup is ambiguous between ::N1 and
::N2::N1. But GCC accepts and selects ::N1.
(Originally filed as a Clang rejects-valid here: https://llvm.org/PR45216)
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/94227] ambiguous lookup for nested-name-specifier in using-declaration is not diagnosed
2020-03-19 19:50 [Bug c++/94227] New: ambiguous lookup for nested-name-specifier in using-declaration is not diagnosed richard-gccbugzilla at metafoo dot co.uk
@ 2020-03-19 19:58 ` mpolacek at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-03-19 19:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94227
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
CC| |mpolacek at gcc dot gnu.org
Last reconfirmed| |2020-03-19
Status|UNCONFIRMED |NEW
Keywords| |accepts-invalid
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, thanks for the report.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-19 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 19:50 [Bug c++/94227] New: ambiguous lookup for nested-name-specifier in using-declaration is not diagnosed richard-gccbugzilla at metafoo dot co.uk
2020-03-19 19:58 ` [Bug c++/94227] " mpolacek 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).