diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-05-19 00:01:19 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-05-19 00:01:19 +0000 |
| commit | 7a77a6bcf9a9b9ae68afe48313d6f78102dcff39 (patch) | |
| tree | 72422978ed34573cd9d5368ebacb88ffdf7505cc /clang/lib/Sema/SemaExpr.cpp | |
| parent | b9509c55fe2950fc217daf30bc90f82635dc231f (diff) | |
| download | bcm5719-llvm-7a77a6bcf9a9b9ae68afe48313d6f78102dcff39.tar.gz bcm5719-llvm-7a77a6bcf9a9b9ae68afe48313d6f78102dcff39.zip | |
Template instantiation for array subscript expressions. This was far
easier than expected because of the limitation that subscript
operators must be member functions.
llvm-svn: 72076
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 418b3b8ce05..ed62b254d56 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1665,6 +1665,14 @@ Sema::ActOnArraySubscriptExpr(Scope *S, ExprArg Base, SourceLocation LLoc, *RHSExp = static_cast<Expr*>(Idx.get()); if (getLangOptions().CPlusPlus && + (LHSExp->isTypeDependent() || RHSExp->isTypeDependent())) { + Base.release(); + Idx.release(); + return Owned(new (Context) ArraySubscriptExpr(LHSExp, RHSExp, + Context.DependentTy, RLoc)); + } + + if (getLangOptions().CPlusPlus && (LHSExp->getType()->isRecordType() || LHSExp->getType()->isEnumeralType() || RHSExp->getType()->isRecordType() || |

