[LLVMbugs] [Bug 5127] New: Non-type template arguments not parsed correctly in default arguments

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Oct 3 03:35:41 PDT 2009


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

           Summary: Non-type template arguments not parsed correctly in
                    default arguments
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: parser
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sebastian.redl at getdesigned.at
                CC: llvmbugs at cs.uiuc.edu


A poster on comp.std.c++ brought up a bug in GCC where the compiler doesn't
compile this code:

template<typename T, int i> struct A {};                                        

struct B {                                                                      
     B(A<double, 0> arg = A<double, 0>()) {}
};

When I tried it out in Clang, I found that it won't compile it either. This is
really peculiar, since I really don't think anything is wrong with this. It
does compile if there is only one template parameter, but the comma is
apparently taken to end the argument.


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