This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/78753] New: non-ambiguous overload resolution with function template partial ordering rules


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

            Bug ID: 78753
           Summary: non-ambiguous overload resolution with function
                    template partial ordering rules
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

In this example:

template <class...> struct pack { };

// (1)
template <class T>
void foo(pack<T> ) { }

// (2)
template <class T, class... Ts>
void foo(pack<T, Ts...> ) { }

int main() {
    foo(pack<int>{});
}

gcc (every version I've tried) accepts the code and invokes (1). But
[temp.deduct.type]/9 states arguments that come from pack expansions should be
ignored if P does not contain a template argument corresponding to it - which
is the case here. So partial ordering deduction should succeed in both cases,
making this ambiguous.

Unfortunately.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]