Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/stable' into merge_stable
- Loading branch information
Showing
4 changed files
with
40 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
// REQUIRED_ARGS: -w | ||
// REQUIRED_ARGS: -de | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag3438.d(15): Warning: constructor diag3438.F1.this default constructor for structs only allowed with @disable, no body, and no parameters | ||
fail_compilation/diag3438.d(16): Warning: constructor diag3438.F2.this default constructor for structs only allowed with @disable, no body, and no parameters | ||
fail_compilation/diag3438.d(17): Warning: constructor diag3438.F3.this default constructor for structs only allowed with @disable, no body, and no parameters | ||
fail_compilation/diag3438.d(19): Warning: constructor diag3438.F5.this default constructor for structs only allowed with @disable, no body, and no parameters | ||
fail_compilation/diag3438.d(20): Warning: constructor diag3438.F6.this default constructor for structs only allowed with @disable, no body, and no parameters | ||
fail_compilation/diag3438.d(16): Deprecation: constructor diag3438.F1.this all parameters have default arguments, but structs cannot have default constructors. | ||
fail_compilation/diag3438.d(17): Deprecation: constructor diag3438.F2.this all parameters have default arguments, but structs cannot have default constructors. | ||
fail_compilation/diag3438.d(20): Deprecation: constructor diag3438.F5.this @disable'd constructor cannot have default arguments for all parameters. | ||
fail_compilation/diag3438.d(20): Deprecation: Use @disable this(); if you want to disable default initialization. | ||
fail_compilation/diag3438.d(21): Deprecation: constructor diag3438.F6.this @disable'd constructor cannot have default arguments for all parameters. | ||
fail_compilation/diag3438.d(21): Deprecation: Use @disable this(); if you want to disable default initialization. | ||
--- | ||
*/ | ||
|
||
import core.vararg; | ||
|
||
struct F1 { this(int x = 1) { } } | ||
struct F2 { this(int x = 1, ...) { } } | ||
struct F3 { this(...) { } } | ||
struct F3 { this(...) { } } // ok | ||
struct F4 { this(int[] x...) { } } // ok | ||
struct F5 { @disable this(int x = 1); } | ||
struct F6 { @disable this(int x = 1) { } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag3438b.d(9): Error: default argument expected for y | ||
--- | ||
*/ | ||
|
||
// Make sure the deprecation doesn't interfere w/ the check for default arguments | ||
struct S { this(int x = 1, int y) { } } |