diff options
| author | Douglas Gregor <dgregor@apple.com> | 2008-12-20 23:49:58 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2008-12-20 23:49:58 +0000 |
| commit | 86f194083504938df72135b5b66bf0c5cafd9498 (patch) | |
| tree | 49bf351536460b89340a2e8b6251c3747a98d1de /lib/CodeGen/CGExpr.cpp | |
| parent | 4306d3cb9116605728252e2738df24b9f6ab53c3 (diff) | |
| download | clang-86f194083504938df72135b5b66bf0c5cafd9498.tar.gz clang-86f194083504938df72135b5b66bf0c5cafd9498.tar.bz2 clang-86f194083504938df72135b5b66bf0c5cafd9498.tar.xz | |
Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.
Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 59d7108e19..b085de304a 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -782,7 +782,9 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { CVRQualifiers = BaseExpr->getType().getCVRQualifiers(); } - FieldDecl *Field = E->getMemberDecl(); + FieldDecl *Field = dyn_cast<FieldDecl>(E->getMemberDecl()); + // FIXME: Handle non-field member expressions + assert(Field && "No code generation for non-field member references"); LValue MemExpLV = EmitLValueForField(BaseValue, Field, isUnion, CVRQualifiers); LValue::SetObjCIvar(MemExpLV, isIvar); return MemExpLV; |
