def err_typecheck_ambiguous_condition : Error<
"conversion %diff{from $ to $|between types}0,1 is ambiguous">;
def err_typecheck_nonviable_condition : Error<
- "no viable conversion%diff{ from $ to $|}0,1">;
+ "no viable conversion%select{%diff{ from $ to $|}1,2|"
+ "%diff{ from returned value of type $ to function return type $|}1,2}0">;
def err_typecheck_nonviable_condition_incomplete : Error<
"no viable conversion%diff{ from $ to incomplete type $|}0,1">;
def err_typecheck_deleted_function : Error<
diag::err_typecheck_nonviable_condition_incomplete,
Args[0]->getType(), Args[0]->getSourceRange()))
S.Diag(Kind.getLocation(), diag::err_typecheck_nonviable_condition)
+ << (Entity.getKind() == InitializedEntity::EK_Result)
<< Args[0]->getType() << Args[0]->getSourceRange()
<< DestType.getNonReferenceType();
diag::err_typecheck_nonviable_condition_incomplete,
From->getType(), From->getSourceRange()))
Diag(From->getLocStart(), diag::err_typecheck_nonviable_condition)
- << From->getType() << From->getSourceRange() << ToType;
+ << false << From->getType() << From->getSourceRange() << ToType;
} else
return false;
CandidateSet.NoteCandidates(*this, OCD_AllCandidates, From);
static double dfi(int i) { return i + 3.14; }
static Local localfi(int) { return Local{}; }
};
- auto l4 = [](auto (*fp)(int)) -> int { return fp(3); }; //expected-error{{no viable conversion from 'Local' to 'int'}}
+ auto l4 = [](auto (*fp)(int)) -> int { return fp(3); }; //expected-error{{no viable conversion from returned value of type 'Local' to function return type 'int'}}
l4(&Local::ifi);
l4(&Local::cfi);
l4(&Local::dfi);
template<typename T>
int infer_result(T x, T y) {
auto lambda = [=](bool b) { return x + y; };
- return lambda(true); // expected-error{{no viable conversion from 'X' to 'int'}}
+ return lambda(true); // expected-error{{no viable conversion from returned value of type 'X' to function return type 'int'}}
}
template int infer_result(int, int);
else if (0) // Copy from reference can't be elided
return r; // expected-error {{call to deleted constructor}}
else // Construction from different type can't be elided
- return i; // expected-error {{no viable conversion from 'int' to 'MoveOnly'}}
+ return i; // expected-error {{no viable conversion from returned value of type 'int' to function return type 'MoveOnly'}}
}