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

           Summary: clang ignores candidate template
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


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

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

  b2944243.cc:17:3: error: no matching function for call to 'array_lengthof'
    array_lengthof(Description<int>::data);
    ^~~~~~~~~~~~~~
  b2944243.cc:2:5: note: candidate template ignored: failed template argument
        deduction
  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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to