]> granicus.if.org Git - clang/commit
Restrict vector component access (using "." and "[]") to variables.
authorSteve Naroff <snaroff@apple.com>
Fri, 3 Aug 2007 22:40:33 +0000 (22:40 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 3 Aug 2007 22:40:33 +0000 (22:40 +0000)
commit608e0ee4b4b8c313dd5e1b4407f742d8bff246b3
tree72afbb885c504f18c4df8b37eb9cd494eb76a5cd
parentd04fdd5f99f985abf2e7b7d7d4d427eebe001e55
Restrict vector component access (using "." and "[]") to variables.
Chris suggested this, since it simplifies the code generator.
If this features is needed (and we don't think it is), we can revisit.

The following test case now produces an error.
[dylan:~/llvm/tools/clang] admin% cat t.c

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

static void test() {
    float4 vec4;

    vec4.rg.g;
    vec4.rg[1];
}
[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.c
t.c:8:12: error: vector component access limited to variables
    vec4.rg.g;
           ^~
t.c:9:12: error: vector component access limited to variables
    vec4.rg[1];
           ^~~
2 diagnostics generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40795 91177308-0d34-0410-b5e6-96231b3b80d8
Sema/SemaExpr.cpp
include/clang/Basic/DiagnosticKinds.def
test/Parser/ocu_vector_components.c