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

            Bug ID: 16288
           Summary: Deduced template parameter after defaulted template
                    parameter not working for static class member
           Product: clang
           Version: 3.2
          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

Consider the following example :

----------------------------------------
#include <iostream>
#include <tuple>

template <class Type>
struct Getter
{
    template <unsigned int Index = 0, class Tuple>
    static inline Type get(const Tuple& tuple);
};

template <class Type>
template <unsigned int Index, class Tuple>
inline Type Getter<Type>::get(const Tuple& tuple)
{
    return std::get<Index>(tuple);
}

int main(int argc, char* argv[])
{
    std::cout<<Getter<int>::get(std::make_tuple(42))<<std::endl;
    return 0;
}
----------------------------------------

Under "clang++ 3.2-1~exp9ubuntu1", it produces the following error :
----------------------------------------
defaulttemplate.cpp:12:37: error: template parameter missing a default argument
template <unsigned int Index, class Tuple>
                                    ^
defaulttemplate.cpp:7:36: note: previous default template argument defined here
    template <unsigned int Index = 0, class Tuple>
----------------------------------------

If the member is defined inside the class declaration, clang++ does not
complain anymore.

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