public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110330] New: GCC does not diagnose ambiguous function introduced from base class
@ 2023-06-20 22:28 csaba_22 at yahoo dot co.uk
  2023-06-20 22:36 ` [Bug c++/110330] " pinskia at gcc dot gnu.org
  2023-06-20 22:42 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: csaba_22 at yahoo dot co.uk @ 2023-06-20 22:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110330

            Bug ID: 110330
           Summary: GCC does not diagnose ambiguous function introduced
                    from base class
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: csaba_22 at yahoo dot co.uk
  Target Milestone: ---

The following code

struct Foo{};
struct Bar{};

struct Base {
    Foo func1(const Foo , const Bar = Bar{}) const {
        return {};
    };
};

struct Derived : public Base {
    using Base::func1;
    Foo func1(const Foo ) const {
        return {};
    };
};

int main() {
    Foo foo;
    Derived der;
    der.func1(foo);
}

is rejected by ICX and clang, but accepted by GCC (up to 13.1).
https://godbolt.org/z/4M3rrs3r4

The consensus at
https://stackoverflow.com/questions/76517300/gcc-does-not-see-function-introduced-from-base-class-as-ambiguous
seems to be that this is a bug.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84832 was shown as a possible
duplicate, although the problem there wasn't ambiguity.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-20 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20 22:28 [Bug c++/110330] New: GCC does not diagnose ambiguous function introduced from base class csaba_22 at yahoo dot co.uk
2023-06-20 22:36 ` [Bug c++/110330] " pinskia at gcc dot gnu.org
2023-06-20 22:42 ` 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).