http://llvm.org/bugs/show_bug.cgi?id=22601

            Bug ID: 22601
           Summary: defaulted class template parameters dropped when
                    rededucing template template parameter
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

The following code compiles successfully with gcc and fails with clang. I
honestly don't know for certain who is right here, but I would really like gcc
to be right.

template<typename...> struct list;

template<template<typename...> class A>
struct wrap
{
  template<typename X, typename T = wrap>
  struct impl;
  template<typename...X, template<typename...> class D>
  struct impl<list<X...>, wrap<D>>
  {
    using type = D<X...>;
  };
  template<typename...T>
  using apply = typename impl<list<T...>>::type;
};

template<typename A, typename B> struct L;
template<typename A, typename B = void> struct L {};

int main()
{
  wrap<L>::apply<int> s;
}

The error clang gives is:

test.cpp:15:18: error: too few template arguments for class template 'L'
    using type = D<X...>;
                 ^
test.cpp:18:3: note: in instantiation of template class
      'wrap<L>::impl<list<int>, wrap<L> >' requested here
  using apply = typename impl<list<T...>>::type;
  ^
test.cpp:28:12: note: in instantiation of template type alias 'apply' requested
here
  wrap<L>::apply<int> s;
           ^
test.cpp:23:41: note: template is declared here
template<typename A, typename B> struct L;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to