Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaExprCXX.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 6,891 Lines • ▼ Show 20 Lines | |||||
ExprResult Sema::MaybeBindToTemporary(Expr *E) { | ExprResult Sema::MaybeBindToTemporary(Expr *E) { | ||||
if (!E) | if (!E) | ||||
return ExprError(); | return ExprError(); | ||||
assert(!isa<CXXBindTemporaryExpr>(E) && "Double-bound temporary?"); | assert(!isa<CXXBindTemporaryExpr>(E) && "Double-bound temporary?"); | ||||
// If the result is a glvalue, we shouldn't bind it. | // If the result is a glvalue, we shouldn't bind it. | ||||
if (!E->isPRValue()) | if (E->isGLValue()) | ||||
return E; | return E; | ||||
// In ARC, calls that return a retainable type can return retained, | // In ARC, calls that return a retainable type can return retained, | ||||
// in which case we have to insert a consuming cast. | // in which case we have to insert a consuming cast. | ||||
if (getLangOpts().ObjCAutoRefCount && | if (getLangOpts().ObjCAutoRefCount && | ||||
E->getType()->isObjCRetainableType()) { | E->getType()->isObjCRetainableType()) { | ||||
bool ReturnsRetained; | bool ReturnsRetained; | ||||
▲ Show 20 Lines • Show All 1,952 Lines • Show Last 20 Lines |