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

            Bug ID: 67928
           Summary: Ambiguous call not diagnosed
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexpolt at yandex dot ru
  Target Milestone: ---

In the following code the call to 'print' is not diagnosed as ambiguous. Clang
is ok.

void print() {}

template<class T, class... types>
void print( const T& arg1, const types&... args );

template<class T, class... types, unsigned U = sizeof(&T::to_string)>
void print( const T& arg1, const types&... args ) {
    print( args... );
}

template<class T, class... types>
void print( const T& arg1, const types&... args ) {
    print( args... );
}


struct test { void to_string() const {} };

int main() {
        print( test{}, 1 );
}

gcc version 5.2.0 (GCC-explorer-build)
Target: x86_64-linux-gnu
Options: -O2 -std=c++14 -Wall -pedantic
Link to godbolt: http://goo.gl/iBMNJK

Reply via email to