summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-01-09 01:39:09 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-01-09 01:39:09 +0000
commit4f217684c78f398c956bbe889b9c6165df1a3a77 (patch)
tree7a94be9c261eb1a9d3b585ac9ddeeb12a8add361 /clang/lib/AST/Expr.cpp
parent6c39269a4c5617fab7d1c36c372db82e51e4c925 (diff)
downloadbcm5719-llvm-4f217684c78f398c956bbe889b9c6165df1a3a77.tar.gz
bcm5719-llvm-4f217684c78f398c956bbe889b9c6165df1a3a77.zip
Sema: Dependent array designators cannot be checked
We forgot to mark designated initializer expression that contain type dependent array designators as type dependent. This would lead to crashes when we try to determine which array element we were trying to initialize. This fixes PR22056. llvm-svn: 225494
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 21e668f68ff..db912d1d369 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -3827,7 +3827,7 @@ DesignatedInitExpr::DesignatedInitExpr(const ASTContext &C, QualType Ty,
// Compute type- and value-dependence.
Expr *Index = IndexExprs[IndexIdx];
if (Index->isTypeDependent() || Index->isValueDependent())
- ExprBits.ValueDependent = true;
+ ExprBits.TypeDependent = ExprBits.ValueDependent = true;
if (Index->isInstantiationDependent())
ExprBits.InstantiationDependent = true;
// Propagate unexpanded parameter packs.
@@ -3842,7 +3842,7 @@ DesignatedInitExpr::DesignatedInitExpr(const ASTContext &C, QualType Ty,
Expr *End = IndexExprs[IndexIdx + 1];
if (Start->isTypeDependent() || Start->isValueDependent() ||
End->isTypeDependent() || End->isValueDependent()) {
- ExprBits.ValueDependent = true;
+ ExprBits.TypeDependent = ExprBits.ValueDependent = true;
ExprBits.InstantiationDependent = true;
} else if (Start->isInstantiationDependent() ||
End->isInstantiationDependent()) {
OpenPOWER on IntegriCloud