Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/src/dmd/globals.d
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ extern (C++) struct Param
bool useDIP1021; // implement https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1021.md
FeatureState fieldwise; // do struct equality testing field-wise rather than by memcmp()
bool fixAliasThis; // if the current scope has an alias this, check it before searching upper scopes
FeatureState rvalueRefParam; // allow rvalues to be arguments to ref parameters
FeatureState rvalueRefParam = FeatureState.enabled;
// allow rvalues to be arguments to ref parameters
// https://dconf.org/2019/talks/alexandrescu.html
// https://gist.github.com/andralex/e5405a5d773f07f73196c05f8339435a
// https://digitalmars.com/d/archives/digitalmars/D/Binding_rvalues_to_ref_parameters_redux_325087.html
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/templatesem.d
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ extern (D) MATCHpair deduceFunctionTemplateMatch(TemplateDeclaration td, Templat
{
// Allow conversion from T[lwr .. upr] to ref T[upr-lwr]
}
else if (global.params.rvalueRefParam == FeatureState.enabled)
else if (global.params.rvalueRefParam == FeatureState.enabled && prmtype.ty != Tvoid)
{
// Allow implicit conversion to ref
}
Expand Down