[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
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: 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)
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.
More information about the llvm-bugs
mailing list