[LLVMbugs] [Bug 8646] New: Default arguments with more than one template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 18 02:45:49 PST 2010


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

           Summary: Default arguments with more than one template
           Product: clang
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: damienrg+bug at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


clang++ should compile this code:

template <class T, class U>
struct DefaultParameter
{};

template <class T, class U>
struct Test
{
  Test(const DefaultParameter<T, U> & d = DefaultParameter<T, U>())
  {}
};

int main()
{
  return 0;
}

The current output is:
clang++ produces the following errors:
main.cpp:8:64: error: expected ')'
  Test(const DefaultParameter<T, U> & d = DefaultParameter<T, U>())
                                                               ^
main.cpp:8:7: note: to match this '('
  Test(const DefaultParameter<T, U> & d = DefaultParameter<T, U>())
      ^
main.cpp:8:61: error: expected '>'
  Test(const DefaultParameter<T, U> & d = DefaultParameter<T, U>())
                                                            ^
2 errors generated.

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