This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/63825] New: [DR 1558] Unused arguments in alias template specializations


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

            Bug ID: 63825
           Summary: [DR 1558] Unused arguments in alias template
                    specializations
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
                CC: jason at gcc dot gnu.org

http://open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1558

I managed to produce a testcase that still fails with GCC, confirming Walter's
claim that a workaround is needed to implement void_t in G++:

template<typename...> using void_t = void;

template<typename Functor, typename = void_t<>>
  struct Maybe_get_result_type
  { };

template<typename Functor>
  struct Maybe_get_result_type<Functor,
                               void_t<typename Functor::result_type>>
  { typedef typename Functor::result_type result_type; };

template<typename T>
struct wrapper
: Maybe_get_result_type<T>
{
  T* t;
};

class X { };

wrapper<X> w;


void_t.cc: In instantiation of âstruct Maybe_get_result_type<X, void>â:
void_t.cc:13:8:   required from âstruct wrapper<X>â
void_t.cc:21:12:   required from here
void_t.cc:10:43: error: no type named âresult_typeâ in âclass Xâ
   { typedef typename Functor::result_type result_type; };
                                           ^

EDG doesn't compile this either, but Clang does.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]