From 22011e90c992533411d2efc17f5efd365a636117 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Tue, 19 Feb 2008 01:11:03 +0000 Subject: 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]; llvm-svn: 47295 --- clang/Sema/SemaExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp index 0d48ad7aa52..31cdc5947f4 100644 --- a/clang/Sema/SemaExpr.cpp +++ b/clang/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... -- cgit v1.2.3