diff options
| author | Bill Wendling <isanbard@gmail.com> | 2018-11-09 00:41:36 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2018-11-09 00:41:36 +0000 |
| commit | ed611fa5aace7533cbd8ffcf27fdcc5208bfaa2f (patch) | |
| tree | f5e40550687ce7795444e440b9a9968c0f5b4dd1 /lib/CodeGen/CGExprAgg.cpp | |
| parent | 130d3d039ee8886084c8dfe038b3183db72f6788 (diff) | |
| download | clang-ed611fa5aace7533cbd8ffcf27fdcc5208bfaa2f.tar.gz | |
Compound literals, enums, et al require const expr
Summary:
Compound literals, enums, file-scoped arrays, etc. require their
initializers and size specifiers to be constant. Wrap the initializer
expressions in a ConstantExpr so that we can easily check for this later
on.
Reviewers: rsmith, shafik
Reviewed By: rsmith
Subscribers: cfe-commits, jyknight, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D53921
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 42481939fa..db49b3f28a 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -125,6 +125,10 @@ public: return Visit(E->getReplacement()); } + void VisitConstantExpr(ConstantExpr *E) { + return Visit(E->getSubExpr()); + } + // l-values. void VisitDeclRefExpr(DeclRefExpr *E) { EmitAggLoadOfLValue(E); } void VisitMemberExpr(MemberExpr *ME) { EmitAggLoadOfLValue(ME); } |
