forked from OSchip/llvm-project
Handle member expressions that return references correctly.
llvm-svn: 80723
This commit is contained in:
parent
783ab50b33
commit
c82555fb85
|
@ -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:
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue