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

            Bug ID: 89883
           Summary: Excessive candidates for ambiguous overload in error
                    message
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: joerg.rich...@pdv-fs.de
  Target Milestone: ---

This code:

#include <ostream>

enum Foo
{
  Bar
};

std::ostream operator<<( std::ostream& os, Foo );
std::ostream operator<<( std::ostream& os, Foo const& );

void func( std::ostream& os )
{
  os << Bar;
}


Generates around 70 lines of error message. 

But in this case there are really only 2 conflicting overloads.  One for 'Foo'
and one for 'Foo const&'.  They both match better than any other overload.

Can GCC output just the two more matching overloads in this case?

Reply via email to