http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57429

            Bug ID: 57429
           Summary: Dependent function call with one visible declaration,
                    deleted
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: potswa at mac dot com

A dependent function call can't be resolved until instantiation time, but if
there's only one candidate visible from the template definition, that candidate
is accessed such as to produce an error if deleted, even if it would be
eliminated by the first stages of overload resolution.

Clang accepts this valid TU but GCC produces two errors. Also a good idea to
test in a SFINAE context, which is where this cropped up.

void f() = delete;

template< typename t >
void ft() { f( t() ); }

template< typename t >
struct ct { decltype( f( t() ) ) m; };

The workaround is to define another overload, which may also be deleted.

Reply via email to