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

            Bug ID: 57576
           Summary: Using declaration hides template for purposes of
                    explicit instantiation
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

The following is incorrectly rejected by all active releases:

namespace std
{
  template<typename T, typename U>
    void remove(T, U)
    { }
}

int remove(char);

namespace std
{
  using ::remove;
}

namespace std
{
  template void remove(int, long);
}


r.cc:17:33: error: ‘void std::remove(int, long int)’ is not declared in ‘std’

Reversing the order of the two declarations of std::remove makes it compile. 
Using remove<> for the explicit instantiation makes it compile.

This causes
libstdc++-v3/testsuite/25_algorithms/remove/requirements/explicit_instantiation/2.cc
to fail in C++11 mode.

Reply via email to