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

            Bug ID: 79591
           Summary: [concepts] failure to distinguish overloads from
                    different namespaces with differing constraints
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

Created attachment 40772
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40772&action=edit
Minimal repro

GCC 6.3 and trunk both miscompile this program:

template <class> concept bool True = true;

// Fine.
namespace X {
  void f(auto) {}
  void f(True) {}
}

void f(auto) {}
namespace Y {
  void f(True) {}
  using ::f;
  // error: 'template<class auto:3> void f(auto:3)' conflicts with a previous
declaration
}

The compiler is happy to overload when the two abbreviated function templates
are declared in the same scope - as in namespace X - but not when one is
imported into the namespace via a using declaration.

Reply via email to