Handle member expressions that return references correctly.

llvm-svn: 80723
This commit is contained in:
Anders Carlsson 2009-09-01 21:18:52 +00:00
parent 783ab50b33
commit c82555fb85
2 changed files with 9 additions and 0 deletions

View File

@ -195,6 +195,7 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) {
case Expr::BinaryOperatorClass:
return EmitBinaryOperatorLValue(cast<BinaryOperator>(E));
case Expr::CallExprClass:
case Expr::CXXMemberCallExprClass:
case Expr::CXXOperatorCallExprClass:
return EmitCallExprLValue(cast<CallExpr>(E));
case Expr::VAArgExprClass:

View File

@ -87,3 +87,11 @@ int reference_decl() {
const int& b = 1;
return a+b;
}
struct A {
int& b();
};
void f(A* a) {
int b = a->b();
}