[LLVMbugs] [Bug 20157] New: ext_vector_type is not compatible with constexpr

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jun 28 14:02:27 PDT 2014


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

            Bug ID: 20157
           Summary: ext_vector_type is not compatible with constexpr
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chris.a.ferguson at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

It seems many uses of a type based on ext_vector_type are not suitable for use
in a constexpr, for example:

typedef float __attribute__((ext_vector_type(4))) float4;

constexpr float4 MultiplyByTwo(float4 x)
{
  return x * 2.0f; 
}

main.cpp:3:18: error: constexpr function never produces a constant expression
[-Winvalid-constexpr]

constexpr float4 MultiplyByTwo(float4 x)
                 ^
main.cpp:5:12: note: subexpression not valid in a constant expression

  return x * 2.0f; 
           ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140628/f1a8036f/attachment.html>


More information about the llvm-bugs mailing list