"%0 is always %select{zero|false|NULL}1 in this context">;
// assignment related diagnostics (also for argument passing, returning, etc).
-// FIXME: %2 is an english string here.
+// In most of these diagnostics the %2 is a value from the
+// Sema::AssignmentAction enumeration
def err_typecheck_convert_incompatible : Error<
- "incompatible type %2 %1, expected %0">;
+ "incompatible type %select{assigning|passing|returning|converting|initializing|sending|casting}2"
+ " %1, expected %0">;
def err_typecheck_convert_ambiguous : Error<
"ambiguity in initializing value of type %0 with initializer of type %1">;
def err_cannot_initialize_decl_noname : Error<
def err_cannot_initialize_decl : Error<
"cannot initialize %0 with an %select{rvalue|lvalue}1 of type %2">;
def warn_incompatible_qualified_id : Warning<
- "incompatible type %2 %1, expected %0">;
+ "incompatible type %select{assigning|passing|returning|converting|initializing|sending|casting}2"
+ " %1, expected %0">;
def ext_typecheck_convert_pointer_int : ExtWarn<
- "incompatible pointer to integer conversion %2 %1, expected %0">;
+ "incompatible pointer to integer conversion "
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
def ext_typecheck_convert_int_pointer : ExtWarn<
- "incompatible integer to pointer conversion %2 %1, expected %0">;
+ "incompatible integer to pointer conversion "
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
def ext_typecheck_convert_pointer_void_func : Extension<
- "%2 %1 converts between void* and function pointer, expected %0">;
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2"
+ " %1 converts between void* and function pointer, expected %0">;
def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
- "pointer types point to integer types with different sign %2 %1, expected %0">,
+ "pointer types point to integer types with different sign "
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">,
InGroup<DiagGroup<"pointer-sign">>;
def ext_typecheck_convert_incompatible_pointer : ExtWarn<
- "incompatible pointer types %2 %1, expected %0">;
+ "incompatible pointer types "
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
def ext_typecheck_convert_discards_qualifiers : ExtWarn<
- "%2 %1 discards qualifiers, expected %0">;
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2"
+ " %1 discards qualifiers, expected %0">;
def ext_nested_pointer_qualifier_mismatch : ExtWarn<
- "%2, %0 and %1 have different qualifiers in nested pointer types">;
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2,"
+ " %0 and %1 have different qualifiers in nested pointer types">;
def warn_incompatible_vectors : Warning<
- "incompatible vector types %2 %1, expected %0">,
+ "incompatible vector types %select{assigning|passing|returning|converting|initializing|sending|casting}2"
+ " %1, expected %0">,
InGroup<VectorConversions>, DefaultIgnore;
def err_int_to_block_pointer : Error<
- "invalid conversion %2 integer %1, expected block pointer %0">;
+ "invalid conversion "
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2"
+ " integer %1, expected block pointer %0">;
def err_typecheck_comparison_of_distinct_blocks : Error<
"comparison of distinct block types (%0 and %1)">;
def err_typecheck_convert_incompatible_block_pointer : Error<
- "incompatible block pointer types %2 %1, expected %0">;
+ "incompatible block pointer types "
+ "%select{assigning|passing|returning|converting|initializing|sending|casting}2 %1, expected %0">;
def err_typecheck_array_not_modifiable_lvalue : Error<
"array type %0 is not assignable">;
void MergeVarDecl(VarDecl *New, LookupResult &OldDecls);
bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old);
+ // AssignmentAction - This is used by all the assignment diagnostic functions
+ // to represent what is actually causing the operation
+ enum AssignmentAction {
+ AA_Assigning,
+ AA_Passing,
+ AA_Returning,
+ AA_Converting,
+ AA_Initializing,
+ AA_Sending,
+ AA_Casting
+ };
+
/// C++ Overloading.
enum OverloadKind {
/// This is a legitimate overload: the existing declarations are
TryCopyInitialization(Expr* From, QualType ToType,
bool SuppressUserConversions, bool ForceRValue,
bool InOverloadResolution);
+
bool PerformCopyInitialization(Expr *&From, QualType ToType,
- const char *Flavor, bool Elidable = false);
+ AssignmentAction Action, bool Elidable = false);
ImplicitConversionSequence
TryObjectArgumentInitialization(QualType FromType, CXXMethodDecl *Method,
/// represent it in the AST.
Incompatible
};
-
+
/// DiagnoseAssignmentResult - Emit a diagnostic, if required, for the
/// assignment conversion type specified by ConvTy. This returns true if the
/// conversion was invalid or false if the conversion was accepted.
bool DiagnoseAssignmentResult(AssignConvertType ConvTy,
SourceLocation Loc,
QualType DstType, QualType SrcType,
- Expr *SrcExpr, const char *Flavor);
+ Expr *SrcExpr, AssignmentAction Action);
/// CheckAssignmentConstraints - Perform type checking for assignment,
/// argument passing, variable initialization, and function return values.
bool CheckExceptionSpecCompatibility(Expr *From, QualType ToType);
bool PerformImplicitConversion(Expr *&From, QualType ToType,
- const char *Flavor,
+ AssignmentAction Action,
bool AllowExplicit = false,
bool Elidable = false);
bool PerformImplicitConversion(Expr *&From, QualType ToType,
- const char *Flavor,
+ AssignmentAction Action,
bool AllowExplicit,
bool Elidable,
ImplicitConversionSequence& ICS);
bool PerformImplicitConversion(Expr *&From, QualType ToType,
const ImplicitConversionSequence& ICS,
- const char *Flavor,
+ AssignmentAction Action,
bool IgnoreBaseAccess = false);
bool PerformImplicitConversion(Expr *&From, QualType ToType,
const StandardConversionSequence& SCS,
- const char *Flavor, bool IgnoreBaseAccess);
+ AssignmentAction Action, bool IgnoreBaseAccess);
bool BuildCXXDerivedToBaseExpr(Expr *&From, CastExpr::CastKind CastKind,
- const ImplicitConversionSequence& ICS,
- const char *Flavor);
+ const ImplicitConversionSequence& ICS);
/// the following "Check" methods will return a valid/converted QualType
/// or a null QualType (indicating an error diagnostic was issued).
// The conversion is possible, so commit to it.
Kind = CastExpr::CK_NoOp;
msg = 0;
- return Self.PerformImplicitConversion(SrcExpr, DestType, ICS, "casting",
+ return Self.PerformImplicitConversion(SrcExpr, DestType, ICS, Sema::AA_Casting,
/*IgnoreBaseAccess*/CStyle) ?
TC_Failed : TC_Success;
}
}
else
NewExp = (Expr*)Args[0];
- if (PerformCopyInitialization(NewExp, FieldType, "passing"))
+ if (PerformCopyInitialization(NewExp, FieldType, AA_Passing))
return true;
Args[0] = NewExp;
}
(T1->isRecordType() || T2->isRecordType())) {
if (!ICS)
Diag(DeclLoc, diag::err_typecheck_convert_incompatible)
- << DeclType << Init->getType() << "initializing" << Init->getSourceRange();
+ << DeclType << Init->getType() << AA_Initializing << Init->getSourceRange();
return true;
}
return ICS->ConversionKind == ImplicitConversionSequence::BadConversion;
} else {
ImplicitConversionSequence Conversions;
- bool badConversion = PerformImplicitConversion(Init, T1, "initializing",
+ bool badConversion = PerformImplicitConversion(Init, T1, AA_Initializing,
false, false,
Conversions);
if (badConversion) {
return true;
// Pass the argument.
- if (PerformCopyInitialization(Arg, ProtoArgType, "passing"))
+ if (PerformCopyInitialization(Arg, ProtoArgType, AA_Passing))
return true;
if (!ProtoArgType->isReferenceType())
// expression is implicitly converted (C++ 4) to the
// cv-unqualified type of the left operand.
if (PerformImplicitConversion(rExpr, lhsType.getUnqualifiedType(),
- "assigning"))
+ AA_Assigning))
return Incompatible;
return Compatible;
}
return InvalidOperands(Loc, lex, rex);
if (PerformImplicitConversion(lex, Context.BoolTy, LHS,
- "passing", /*IgnoreBaseAccess=*/false))
+ AA_Passing, /*IgnoreBaseAccess=*/false))
return InvalidOperands(Loc, lex, rex);
StandardConversionSequence RHS;
return InvalidOperands(Loc, lex, rex);
if (PerformImplicitConversion(rex, Context.BoolTy, RHS,
- "passing", /*IgnoreBaseAccess=*/false))
+ AA_Passing, /*IgnoreBaseAccess=*/false))
return InvalidOperands(Loc, lex, rex);
// C++ [expr.log.and]p2
}
if (DiagnoseAssignmentResult(ConvTy, Loc, LHSType, RHSType,
- RHS, "assigning"))
+ RHS, AA_Assigning))
return QualType();
// C99 6.5.16p3: The type of an assignment expression is the type of the
bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
SourceLocation Loc,
QualType DstType, QualType SrcType,
- Expr *SrcExpr, const char *Flavor) {
+ Expr *SrcExpr, AssignmentAction Action) {
// Decode the result (notice that AST's are still created for extensions).
bool isInvalid = false;
unsigned DiagKind;
break;
}
- Diag(Loc, DiagKind) << DstType << SrcType << Flavor
+ Diag(Loc, DiagKind) << DstType << SrcType << Action
<< SrcExpr->getSourceRange() << Hint;
return isInvalid;
}
// Whatch out for variadic allocator function.
unsigned NumArgsInFnDecl = FnDecl->getNumParams();
for (unsigned i = 0; (i < NumArgs && i < NumArgsInFnDecl); ++i) {
- // FIXME: Passing word to diagnostic.
if (PerformCopyInitialization(Args[i],
FnDecl->getParamDecl(i)->getType(),
- "passing"))
+ AA_Passing))
return true;
}
Operator = FnDecl;
Operand.release();
if (!PerformImplicitConversion(Ex,
ObjectPtrConversions.front()->getConversionType(),
- "converting")) {
+ AA_Converting)) {
Operand = Owned(Ex);
Type = Ex->getType();
}
/// resolution works differently in that case.
bool
Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
- const char *Flavor, bool AllowExplicit,
+ AssignmentAction Action, bool AllowExplicit,
bool Elidable) {
ImplicitConversionSequence ICS;
- return PerformImplicitConversion(From, ToType, Flavor, AllowExplicit,
+ return PerformImplicitConversion(From, ToType, Action, AllowExplicit,
Elidable, ICS);
}
bool
Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
- const char *Flavor, bool AllowExplicit,
+ AssignmentAction Action, bool AllowExplicit,
bool Elidable,
ImplicitConversionSequence& ICS) {
ICS.ConversionKind = ImplicitConversionSequence::BadConversion;
/*ForceRValue=*/false,
/*InOverloadResolution=*/false);
}
- return PerformImplicitConversion(From, ToType, ICS, Flavor);
+ return PerformImplicitConversion(From, ToType, ICS, Action);
}
/// BuildCXXDerivedToBaseExpr - This routine generates the suitable AST
/// necessary information is passed in ICS.
bool
Sema::BuildCXXDerivedToBaseExpr(Expr *&From, CastExpr::CastKind CastKind,
- const ImplicitConversionSequence& ICS,
- const char *Flavor) {
+ const ImplicitConversionSequence& ICS) {
QualType BaseType =
QualType::getFromOpaquePtr(ICS.UserDefined.After.ToTypePtr);
// Must do additional defined to base conversion.
/// expression From to the type ToType using the pre-computed implicit
/// conversion sequence ICS. Returns true if there was an error, false
/// otherwise. The expression From is replaced with the converted
-/// expression. Flavor is the kind of conversion we're performing,
+/// expression. Action is the kind of conversion we're performing,
/// used in the error message.
bool
Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
const ImplicitConversionSequence &ICS,
- const char* Flavor, bool IgnoreBaseAccess) {
+ AssignmentAction Action, bool IgnoreBaseAccess) {
switch (ICS.ConversionKind) {
case ImplicitConversionSequence::StandardConversion:
- if (PerformImplicitConversion(From, ToType, ICS.Standard, Flavor,
+ if (PerformImplicitConversion(From, ToType, ICS.Standard, Action,
IgnoreBaseAccess))
return true;
break;
// Whatch out for elipsis conversion.
if (!ICS.UserDefined.EllipsisConversion) {
if (PerformImplicitConversion(From, BeforeToType,
- ICS.UserDefined.Before, "converting",
+ ICS.UserDefined.Before, AA_Converting,
IgnoreBaseAccess))
return true;
}
// there's some nasty stuff involving MaybeBindToTemporary going on here.
if (ICS.UserDefined.After.Second == ICK_Derived_To_Base &&
ICS.UserDefined.After.CopyConstructor) {
- return BuildCXXDerivedToBaseExpr(From, CastKind, ICS, Flavor);
+ return BuildCXXDerivedToBaseExpr(From, CastKind, ICS);
}
if (ICS.UserDefined.After.CopyConstructor) {
}
return PerformImplicitConversion(From, ToType, ICS.UserDefined.After,
- "converting", IgnoreBaseAccess);
+ AA_Converting, IgnoreBaseAccess);
}
case ImplicitConversionSequence::EllipsisConversion:
bool
Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
const StandardConversionSequence& SCS,
- const char *Flavor, bool IgnoreBaseAccess) {
+ AssignmentAction Action, bool IgnoreBaseAccess) {
// Overall FIXME: we are recomputing too many types here and doing far too
// much extra work. What this means is that we need to keep track of more
// information that is computed when we try the implicit conversion initially,
// Diagnose incompatible Objective-C conversions
Diag(From->getSourceRange().getBegin(),
diag::ext_typecheck_convert_incompatible_pointer)
- << From->getType() << ToType << Flavor
+ << From->getType() << ToType << Action
<< From->getSourceRange();
}
case OR_Success:
// We found a match. Perform the conversions on the arguments and move on.
if (Self.PerformImplicitConversion(LHS, Best->BuiltinTypes.ParamTypes[0],
- Best->Conversions[0], "converting") ||
+ Best->Conversions[0], Sema::AA_Converting) ||
Self.PerformImplicitConversion(RHS, Best->BuiltinTypes.ParamTypes[1],
- Best->Conversions[1], "converting"))
+ Best->Conversions[1], Sema::AA_Converting))
break;
return false;
/*AllowExplicit=*/false,
/*ForceRValue=*/false);
}
- if (Self.PerformImplicitConversion(E, TargetType(ICS), ICS, "converting"))
+ if (Self.PerformImplicitConversion(E, TargetType(ICS), ICS, Sema::AA_Converting))
return true;
return false;
}
LPointee = Context.getQualifiedType(LPointee, MergedQuals);
QualType Common
= Context.getMemberPointerType(LPointee, MoreDerived.getTypePtr());
- if (PerformImplicitConversion(LHS, Common, "converting"))
+ if (PerformImplicitConversion(LHS, Common, Sema::AA_Converting))
return QualType();
- if (PerformImplicitConversion(RHS, Common, "converting"))
+ if (PerformImplicitConversion(RHS, Common, Sema::AA_Converting))
return QualType();
return Common;
}
&& E2ToC2.ConversionKind !=
ImplicitConversionSequence::BadConversion;
if (ToC1Viable && !ToC2Viable) {
- if (!PerformImplicitConversion(E1, Composite1, E1ToC1, "converting") &&
- !PerformImplicitConversion(E2, Composite1, E2ToC1, "converting"))
+ if (!PerformImplicitConversion(E1, Composite1, E1ToC1, Sema::AA_Converting) &&
+ !PerformImplicitConversion(E2, Composite1, E2ToC1, Sema::AA_Converting))
return Composite1;
}
if (ToC2Viable && !ToC1Viable) {
- if (!PerformImplicitConversion(E1, Composite2, E1ToC2, "converting") &&
- !PerformImplicitConversion(E2, Composite2, E2ToC2, "converting"))
+ if (!PerformImplicitConversion(E1, Composite2, E1ToC2, Sema::AA_Converting) &&
+ !PerformImplicitConversion(E2, Composite2, E2ToC2, Sema::AA_Converting))
return Composite2;
}
return QualType();
IsError |=
DiagnoseAssignmentResult(Result, argExpr->getLocStart(), lhsType, rhsType,
- argExpr, "sending");
+ argExpr, AA_Sending);
}
// Promote additional arguments to variadic methods.
if (S.getLangOptions().CPlusPlus) {
// FIXME: I dislike this error message. A lot.
if (S.PerformImplicitConversion(Init, DeclType,
- "initializing", DirectInit)) {
+ Sema::AA_Initializing, DirectInit)) {
ImplicitConversionSequence ICS;
OverloadCandidateSet CandidateSet;
if (S.IsUserDefinedConversion(Init, DeclType, ICS.UserDefined,
true, false, false) != OR_Ambiguous)
return S.Diag(Init->getSourceRange().getBegin(),
diag::err_typecheck_convert_incompatible)
- << DeclType << Init->getType() << "initializing"
+ << DeclType << Init->getType() << Sema::AA_Initializing
<< Init->getSourceRange();
S.Diag(Init->getSourceRange().getBegin(),
diag::err_typecheck_convert_ambiguous)
Sema::AssignConvertType ConvTy =
S.CheckSingleAssignmentConstraints(DeclType, Init);
return S.DiagnoseAssignmentResult(ConvTy, Init->getLocStart(), DeclType,
- InitType, Init, "initializing");
+ InitType, Init, Sema::AA_Initializing);
}
static void CheckStringInit(Expr *Str, QualType &DeclT, Sema &S) {
// destination type.
// FIXME: We're pretending to do copy elision here; return to this when we
// have ASTs for such things.
- if (!PerformImplicitConversion(Init, DeclType, "initializing"))
+ if (!PerformImplicitConversion(Init, DeclType, Sema::AA_Initializing))
return false;
if (InitEntity)
if (ICS.ConversionKind != ImplicitConversionSequence::BadConversion) {
if (SemaRef.PerformImplicitConversion(expr, ElemType, ICS,
- "initializing"))
+ Sema::AA_Initializing))
hadError = true;
UpdateStructuredListElement(StructuredList, StructuredIndex, expr);
++Index;
} else {
// We cannot initialize this element, so let
// PerformCopyInitialization produce the appropriate diagnostic.
- SemaRef.PerformCopyInitialization(expr, ElemType, "initializing");
+ SemaRef.PerformCopyInitialization(expr, ElemType, Sema::AA_Initializing);
hadError = true;
++Index;
++StructuredIndex;
break;
case SK_ConversionSequence:
- if (S.PerformImplicitConversion(CurInitExpr, Step->Type, "converting",
+ if (S.PerformImplicitConversion(CurInitExpr, Step->Type, Sema::AA_Converting,
false, false, *Step->ICS))
return S.ExprError();
/// be true when the copy may be elided (C++ 12.8p15). Overload resolution works
/// differently in C++0x for this case.
bool Sema::PerformCopyInitialization(Expr *&From, QualType ToType,
- const char* Flavor, bool Elidable) {
+ AssignmentAction Action, bool Elidable) {
if (!getLangOptions().CPlusPlus) {
// In C, argument passing is the same as performing an assignment.
QualType FromType = From->getType();
ConvTy = Compatible;
return DiagnoseAssignmentResult(ConvTy, From->getLocStart(), ToType,
- FromType, From, Flavor);
+ FromType, From, Action);
}
if (ToType->isReferenceType())
/*AllowExplicit=*/false,
/*ForceRValue=*/false);
- if (!PerformImplicitConversion(From, ToType, Flavor,
+ if (!PerformImplicitConversion(From, ToType, Action,
/*AllowExplicit=*/false, Elidable))
return false;
if (!DiagnoseMultipleUserDefinedConversion(From, ToType))
return Diag(From->getSourceRange().getBegin(),
diag::err_typecheck_convert_incompatible)
- << ToType << From->getType() << Flavor << From->getSourceRange();
+ << ToType << From->getType() << Action << From->getSourceRange();
return true;
}
/// of the expression From to bool (C++0x [conv]p3).
bool Sema::PerformContextuallyConvertToBool(Expr *&From) {
ImplicitConversionSequence ICS = TryContextuallyConvertToBool(From);
- if (!PerformImplicitConversion(From, Context.BoolTy, ICS, "converting"))
+ if (!PerformImplicitConversion(From, Context.BoolTy, ICS, AA_Converting))
return false;
if (!DiagnoseMultipleUserDefinedConversion(From, Context.BoolTy))
// Convert the arguments.
if (PerformCopyInitialization(Input,
FnDecl->getParamDecl(0)->getType(),
- "passing"))
+ AA_Passing))
return ExprError();
}
// break out so that we will build the appropriate built-in
// operator node.
if (PerformImplicitConversion(Input, Best->BuiltinTypes.ParamTypes[0],
- Best->Conversions[0], "passing"))
+ Best->Conversions[0], AA_Passing))
return ExprError();
break;
if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(FnDecl)) {
if (PerformObjectArgumentInitialization(Args[0], Method) ||
PerformCopyInitialization(Args[1], FnDecl->getParamDecl(0)->getType(),
- "passing"))
+ AA_Passing))
return ExprError();
} else {
// Convert the arguments.
if (PerformCopyInitialization(Args[0], FnDecl->getParamDecl(0)->getType(),
- "passing") ||
+ AA_Passing) ||
PerformCopyInitialization(Args[1], FnDecl->getParamDecl(1)->getType(),
- "passing"))
+ AA_Passing))
return ExprError();
}
// break out so that we will build the appropriate built-in
// operator node.
if (PerformImplicitConversion(Args[0], Best->BuiltinTypes.ParamTypes[0],
- Best->Conversions[0], "passing") ||
+ Best->Conversions[0], AA_Passing) ||
PerformImplicitConversion(Args[1], Best->BuiltinTypes.ParamTypes[1],
- Best->Conversions[1], "passing"))
+ Best->Conversions[1], AA_Passing))
return ExprError();
break;
if (PerformObjectArgumentInitialization(Args[0], Method) ||
PerformCopyInitialization(Args[1],
FnDecl->getParamDecl(0)->getType(),
- "passing"))
+ AA_Passing))
return ExprError();
// Determine the result type
// break out so that we will build the appropriate built-in
// operator node.
if (PerformImplicitConversion(Args[0], Best->BuiltinTypes.ParamTypes[0],
- Best->Conversions[0], "passing") ||
+ Best->Conversions[0], AA_Passing) ||
PerformImplicitConversion(Args[1], Best->BuiltinTypes.ParamTypes[1],
- Best->Conversions[1], "passing"))
+ Best->Conversions[1], AA_Passing))
return ExprError();
break;
// Pass the argument.
QualType ProtoArgType = Proto->getArgType(i);
- IsError |= PerformCopyInitialization(Arg, ProtoArgType, "passing");
+ IsError |= PerformCopyInitialization(Arg, ProtoArgType, AA_Passing);
} else {
OwningExprResult DefArg
= BuildCXXDefaultArgExpr(LParenLoc, Method, Method->getParamDecl(i));
AssignConvertType ConvTy =
CheckSingleAssignmentConstraints(Context.VoidPtrTy, E);
if (DiagnoseAssignmentResult(ConvTy, StarLoc, Context.VoidPtrTy, ETy,
- E, "passing"))
+ E, AA_Passing))
return StmtError();
}
return Owned(new (Context) IndirectGotoStmt(GotoLoc, StarLoc, E));
// In C++ the return statement is handled via a copy initialization.
// the C version of which boils down to CheckSingleAssignmentConstraints.
// FIXME: Leaks RetValExp.
- if (PerformCopyInitialization(RetValExp, FnRetType, "returning"))
+ if (PerformCopyInitialization(RetValExp, FnRetType, AA_Returning))
return StmtError();
if (RetValExp) CheckReturnStackAddr(RetValExp, FnRetType, ReturnLoc);
// In C++ the return statement is handled via a copy initialization.
// the C version of which boils down to CheckSingleAssignmentConstraints.
// FIXME: Leaks RetValExp on error.
- if (PerformCopyInitialization(RetValExp, FnRetType, "returning", Elidable)){
+ if (PerformCopyInitialization(RetValExp, FnRetType, AA_Returning, Elidable)){
// We should still clean up our temporaries, even when we're failing!
RetValExp = MaybeCreateCXXExprWithTemporaries(RetValExp);
return StmtError();