http://llvm.org/bugs/show_bug.cgi?id=11074
Summary: Error generated when enumeration constant used in
templatized wrapper of NEON intrinsic
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Given this code:
#include <arm_neon.h>
#include <stdio.h>
enum Axis
{
X = 0,
Y = 1,
Z = 2,
W = 3
};
template<Axis PARAM>
float32_t foo(float32x4_t a)
{
float32_t value = vgetq_lane_f32(a, PARAM);
return value;
}
int main()
{
float32x4_t a = (float32x4_t){0.f, 1.f, 2.f, 3.f};
printf("%f", foo<W>(a));
}
clang generates an error that the argument to vgetq_lane_f32 should be between
0 and 3. Is it possible to check the template parameter is in the range before
generating an error?
This was encountered with clang-2.9 (iOS SDK 4.3) and verified in trunk as of
revision 141208 with builds targeting iOS ARM.
--
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