[llvm-bugs] [Bug 32491] New: Real warning produced by definition of _cvtss_sh in C++

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Apr 1 18:33:38 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=32491

            Bug ID: 32491
           Summary: Real warning produced by definition of _cvtss_sh in
                    C++
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: thiago at kde.org
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

With the following code in C++:

    b16 = _cvtss_sh(f, 0);

The compiler produces:

/qfloat16.h:119:11: error: compound literals are a C99-specific feature
[-Werror,-Wc99-extensions]
    b16 = _cvtss_sh(f, 0);
          ^
/opt/clang/lib64/clang/5.0.0/include/f16cintrin.h:76:55: note: expanded from
macro '_cvtss_sh'
  ((unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
                                                      ^

This warning is caused by the macro definition in f16cintrin.h as supplied by
Clang.

Please either suppress the warning when it's produced by a macro created in a
Clang-supplied file or fix the file not to produce a warning in C++ mode.

Reproduced with Clang 3.9.1 and 5.0 (trunk)

-- 
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/20170402/c479cc43/attachment.html>


More information about the llvm-bugs mailing list