[LLVMbugs] [Bug 7985] New: clang ignores candidate template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 24 15:47:22 PDT 2010


           Summary: clang ignores candidate template
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Created an attachment (id=5410)
 --> (http://llvm.org/bugs/attachment.cgi?id=5410)

I'm not 100% sure, but I think the attached code is valid. Clang rejects it

  b2944243.cc:17:3: error: no matching function for call to 'array_lengthof'
  b2944243.cc:2:5: note: candidate template ignored: failed template argument
  int array_lengthof(T (&x)[N]) { return N; }
  1 error generated.

Notably, adding the exact length to the array when declared/defined makes it
work. So does detemplatizing Description.

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