Skip to content

Commit

Permalink
Add -revert=aliasaggquals
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrel committed Jul 10, 2020
1 parent e7c930c commit 45b63ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dmd/cli.d
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ dmd -cov -unittest myprog.d
/// Returns all available reverts
static immutable reverts = [
Feature("dip25", "noDIP25", "revert DIP25 changes https://github.com/dlang/DIPs/blob/master/DIPs/archive/DIP25.md"),
Feature("aliasaggquals", "noAliasAggQuals", "drop qualifiers when passing an aggregate type as a template alias parameter"),
];

/// Returns all available previews
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -8083,7 +8083,7 @@ MATCH matchArg(TemplateParameter tp, Scope* sc, RootObject oarg, size_t i, Templ
{
// Don't lose type qualifiers
// https://issues.dlang.org/show_bug.cgi?id=20863
if (ta && ta.mod)
if (!global.params.noAliasAggQuals && ta && ta.mod)
sa = oarg;
m = MATCH.convert;
}
Expand Down
1 change: 1 addition & 0 deletions src/dmd/globals.d
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ extern (C++) struct Param
bool useDIP25; // implement http://wiki.dlang.org/DIP25
bool noDIP25; // revert to pre-DIP25 behavior
bool useDIP1021; // implement https://github.com/dlang/DIPs/blob/master/DIPs/DIP1021.md
bool noAliasAggQuals; // drop qualifiers when passing an aggregate type as a template alias parameter
bool release; // build release version
bool preservePaths; // true means don't strip path from source file
DiagnosticReporting warnings = DiagnosticReporting.off; // how compiler warnings are handled
Expand Down
1 change: 1 addition & 0 deletions test/compilable/reverthelp.d
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ TEST_OUTPUT:
Revertable language changes listed by -revert=name:
=all list information on all revertable language changes
=dip25 revert DIP25 changes https://github.com/dlang/DIPs/blob/master/DIPs/archive/DIP25.md
=aliasaggquals drop qualifiers when passing an aggregate type as a template alias parameter
----
*/

0 comments on commit 45b63ad

Please sign in to comment.