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

            Bug ID: 117410
           Summary: Ambiguous overload with ellipsis
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ddvamp007 at gmail dot com
  Target Milestone: ---

#include <cassert>
#include <type_traits>

template <typename T = void>
bool foo() { return false; }

template <typename T = void>
requires std::is_void_v<T>
bool foo(...) { return true; }

template <int = 0>
bool bar() { return false; }

template <int x = 0>
requires (x == 0)
bool bar(...) { return true; }

int main() {
    assert(foo());
    assert(bar());
}

Compilation error with gcc, ok with clang

It looks like 'true' options are more specialized than 'false' according to
[temp.func.order]

Reply via email to