[llvm-bugs] [Bug 48101] New: [C++] Use of vectors is ternary
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Nov 6 10:07:10 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=48101
Bug ID: 48101
Summary: [C++] Use of vectors is ternary
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: OpenCL
Assignee: unassignedclangbugs at nondot.org
Reporter: anastasia.stulova at arm.com
CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org
This seems to be related to https://bugs.llvm.org/show_bug.cgi?id=33103 but
however it doesn't cover OpenCL code. The change can probably be done
uniformaly.
The main issue is that in C++ condition of ternary operators is contextually
converted to bool while in C they can be any scalar type. This seems to be an
issue because OpenCL doesn't have a bool type for vectors, but however booln is
a reserved identifier.
To allow this potentially some work is needed on the language side first i.e.
could we introduce booln type or could we convert vector types to bool? The
latter potentially means that the behavior between OpenCL C and C++ for OpenCL
is not strickly backward compatible.
--
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/20201106/806aa60e/attachment.html>
More information about the llvm-bugs
mailing list