summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprClassification.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-06-17 21:09:57 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-06-17 21:09:57 +0000
commit66b9e9e9fe5498526070b4c979d652e5e2990612 (patch)
treea357a8069a5a65f6e26ec46e8cff7738115a5360 /clang/lib/AST/ExprClassification.cpp
parent6ce17a4c524dc913eeb4a52006b6ab25cc015458 (diff)
downloadbcm5719-llvm-66b9e9e9fe5498526070b4c979d652e5e2990612.tar.gz
bcm5719-llvm-66b9e9e9fe5498526070b4c979d652e5e2990612.zip
Fix Expr::Classify to correctly classify ExtVectorElementExprs. PR16204.
llvm-svn: 184123
Diffstat (limited to 'clang/lib/AST/ExprClassification.cpp')
-rw-r--r--clang/lib/AST/ExprClassification.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp
index 12510d68830..72f17669ed1 100644
--- a/clang/lib/AST/ExprClassification.cpp
+++ b/clang/lib/AST/ExprClassification.cpp
@@ -291,8 +291,11 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
// Extended vector element access is an lvalue unless there are duplicates
// in the shuffle expression.
case Expr::ExtVectorElementExprClass:
- return cast<ExtVectorElementExpr>(E)->containsDuplicateElements() ?
- Cl::CL_DuplicateVectorComponents : Cl::CL_LValue;
+ if (cast<ExtVectorElementExpr>(E)->containsDuplicateElements())
+ return Cl::CL_DuplicateVectorComponents;
+ if (cast<ExtVectorElementExpr>(E)->isArrow())
+ return Cl::CL_LValue;
+ return ClassifyInternal(Ctx, cast<ExtVectorElementExpr>(E)->getBase());
// Simply look at the actual default argument.
case Expr::CXXDefaultArgExprClass:
OpenPOWER on IntegriCloud