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

            Bug ID: 69957
           Summary: Ambiguous overload due to incorrect partial ordering
                    of V<> and V<Ts...>
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roman.perepelitsa at gmail dot com
  Target Milestone: ---

=== Program #1 ===

  template <class... Ts> struct V {};

  template <class... Ts, class... Us>
  void Foo(V<Ts...>, V<Us&...>) {}

  template <class... Us>
  void Foo(V<>, V<Us&...>) {}

  int main() {
    Foo(V<>(), V<>());
  }

Expected: compiles.
Actual: error: call of overloaded 'Foo(V<>, V<>)' is ambiguous.

=== Program #2 ===

(This might be a different bug)

  template <class... T> struct V {};

  template <class... Ts, class... Us>
  void Foo(V<Ts...>, V<Us&...>) {}

  template <class... Us>
  void Foo(V<>, Us&&...) {}

  int main() {
    Foo(V<>(), V<>());
  }

Expected: error: call of overloaded 'Foo(V<>, V<>)' is ambiguous.
Actual: compiles.

Reply via email to