EDG-based compilers accept (in strict mode) accept this:

template<typename T>
  struct is_void
  { static const bool value = false; };

template<>
  struct is_void<void>
  { static const bool value = true; };

template<typename, bool>
  struct enable_if { };

template<typename T>
  struct enable_if<T, true>
  { typedef T type; };

namespace one
{
  template<typename T>
    typename enable_if<double, is_void<T>::value>::type
    fun(T);
}

namespace two
{
  using one::fun;

  template<typename T>
    typename enable_if<double, !is_void<T>::value>::type
    fun(T);
}

/////////////

paolo:~/Work> g++ -c reduced.cc
reduced.cc:29: error: 'template<class T> typename enable_if<double, (!
is_void<T>::value)>::type two::fun(T)' conflicts with previous using
declaration 'template<class T> typename enable_if<double,
is_void<T>::value>::type one::fun(T)'


-- 
           Summary: enable_if + using troubles
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pcarlini at suse dot de


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

Reply via email to