mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 13:40:11 +03:00
Fix bugzilla 24883 - Speculative template overload error escapes with -preview=rvaluerefparam
This commit is contained in:
parent
347c883586
commit
1a44210ffb
2 changed files with 13 additions and 1 deletions
|
@ -1252,7 +1252,13 @@ extern (D) MATCHpair deduceFunctionTemplateMatch(TemplateDeclaration td, Templat
|
|||
//printf("farg = %s %s\n", farg.type.toChars(), farg.toChars());
|
||||
|
||||
RootObject oarg = farg;
|
||||
if ((fparam.storageClass & STC.ref_) && (!(fparam.storageClass & STC.auto_) || farg.isLvalue()))
|
||||
|
||||
if (farg.isFuncExp())
|
||||
{
|
||||
// When assigning an untyped (void) lambda `x => y` to a `(F)(ref F)` parameter,
|
||||
// we don't want to deduce type void creating a void parameter
|
||||
}
|
||||
else if ((fparam.storageClass & STC.ref_) && (!(fparam.storageClass & STC.auto_) || farg.isLvalue()))
|
||||
{
|
||||
/* Allow expressions that have CT-known boundaries and type [] to match with [dim]
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue