From: Nate Begeman Date: Tue, 19 Feb 2008 01:11:03 +0000 (+0000) Subject: Allow ArraySubscriptExpr to be a base node for vector dereference. This X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60c9b1867fab9d57e6828aa8d36baea703a08ff2;p=clang Allow ArraySubscriptExpr to be a base node for vector dereference. This allows you to do things like typedef __attribute__(( ocu_vector_type(4))) float float4; float4 *x; float y = x[0][2]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47295 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index 0d48ad7aa5..31cdc5947f 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -414,7 +414,7 @@ ActOnArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, IndexExpr = RHSExp; // Component access limited to variables (reject vec4.rg[1]). - if (!isa(BaseExpr)) + if (!isa(BaseExpr) && !isa(BaseExpr)) return Diag(LLoc, diag::err_ocuvector_component_access, SourceRange(LLoc, RLoc)); // FIXME: need to deal with const...