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

            Bug ID: 104365
           Summary: Overload ambiguity not detected
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andris at gcc dot gnu.org
  Target Milestone: ---

Created attachment 52336
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52336&action=edit
Test example

Overload ambiguity is not detected when 2 constructors with parameter types
- bool
- const std::string&
are available and string literal is provided as parameter. Compiler chooses
conversion to bool. Tested with versions gcc-11.2.0 (Arch Linux), gcc-8.5.0
(RHEL 8).

Test example attached

At least warning (or better an error) in this case would be nice as otherwise
failure to detected ambiguity causes difficult to find errors

Reply via email to