http://llvm.org/bugs/show_bug.cgi?id=2657
Summary: Error when accessing vector component from member
variable.
Product: clang
Version: unspecified
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [email protected]
Created an attachment (id=1909)
--> (http://llvm.org/bugs/attachment.cgi?id=1909)
A patch to fix this bug.
clang reports error when accessing vector component from member variable of a
struct.
Here's the code to reproduce the problem.
/* vector_in_struct.c */
typedef float float4 __attribute__((ext_vector_type(4)));
typedef struct _foo {
float4 v;
} foo;
void
test()
{
foo m;
float f0 = m.v.x;
float f1 = (m.v).x;
}
$ clang vector_in_struct.c
vector_in_strcut.c:12:20: error: vector component access limited to variables
float f0 = m.v.x;
~~~ ^
vector_in_strcut.c:13:22: error: vector component access limited to variables
float f1 = (m.v).x;
~~~~~ ^
2 diagnostics generated.
(clang revision: 54607)
--
I think it'd better to allow above vector expression so that programmers can
operate vector expression conveniently in clang.
Attached is a quick patch to fix this problem.
--
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