[LLVMbugs] [Bug 7034] New: Are default args allowed in template function definitions?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 3 17:19:55 PDT 2010


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

           Summary: Are default args allowed in template function
                    definitions?
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: John.Thompson.JTSoftware at gmail.com
                CC: llvmbugs at cs.uiuc.edu


template <typename T> class test
{
    void func(int a);
};
template <typename T> inline void test<T>::func(int a = 1) {}

clang -cc1 hashset.cpp
hashset.cpp:5:53: error: default arguments cannot be added to an out-of-line
definition of a member of a class template
template <typename T> inline void test<T>::func(int a = 1) {}
                                                    ^   ~

This compiles without error in gcc.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list