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

* [Bug c++/110330] GCC does not diagnose ambiguous function introduced from base class
  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 ` pinskia at gcc dot gnu.org
  2023-06-20 22:42 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-20 22:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |82894

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is a dup of bug 82894. Specifically see bug 82894 comment #2 .


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82894
[Bug 82894] [10/11/12/13/14 Regression] Inherited member functions do not
create ambiguity

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

* [Bug c++/110330] GCC does not diagnose ambiguous function introduced from base class
  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
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-20 22:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> I think this is a dup of bug 82894. Specifically see bug 82894 comment #2 .

Yes it is a dup. GCC 6 rejected the code as ambiguous even.

*** This bug has been marked as a duplicate of bug 82894 ***

^ 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).