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

            Bug ID: 18783
           Summary: Wrong "too few template arguments for class template"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

(If we replace type_traits with boost, this is C++03)

#include <type_traits>

template<class,class> struct typeset;
template<class H=void, class T=typename
std::conditional<std::is_same<H,void>::value, void, typeset<void, void> >::type
>
struct typeset {
  typedef typeset type;
};
template<> struct typeset<> {
  typedef typeset type;
  template<class X> struct add : typeset<X> {};
};

typedef typeset<>::add<int>::type XXX;


t.cc:11:34: error: too few template arguments for class template 'typeset'
  template<class X> struct add : typeset<X> {};
                                 ^
t.cc:3:30: note: template is declared here
template<class,class> struct typeset;
~~~~~~~~~~~~~~~~~~~~~        ^
t.cc:14:9: error: no type named 'type' in 'typeset<void, void>::add<int>'; did
      you mean 'typeset<>::type'?
typedef typeset<>::add<int>::type XXX;
        ^~~~~~~~~~~~~~~~~~~~~~~~~
        typeset<>::type
t.cc:10:19: note: 'typeset<>::type' declared here
  typedef typeset type;
                  ^

Note that if I write ::typeset<X> (adding :: in front) it compiles.

Could be related to bug 10147.

-- 
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