[LLVMbugs] [Bug 11074] New: Error generated when enumeration constant used in templatized wrapper of NEON intrinsic

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 5 14:30:00 PDT 2011


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: unassignedclangbugs at nondot.org
        ReportedBy: mburke at ea.com
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list