Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 14283 - spurious 'this' is not an lvalue deprecation for au…
…to ref - suppress deprecation message for auto ref parameters as passing 'this' to auto ref will remain correct when it becomes an rvalue and because it's very unlikely that the passing as ref argument was intentional
- Loading branch information
1 parent
1361181
commit 6db86fd
Showing
2 changed files
with
31 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// REQUIRED_ARGS: -dw | ||
|
||
/* | ||
TEST_OUTPUT: | ||
--- | ||
compilable/deprecate14283.d(17): Deprecation: this is not an lvalue | ||
compilable/deprecate14283.d(18): Deprecation: super is not an lvalue | ||
--- | ||
*/ | ||
|
||
class C | ||
{ | ||
void bug() | ||
{ | ||
autoref(this); // suppress warning for auto ref | ||
autoref(super); // suppress warning for auto ref | ||
ref_(this); // still warns | ||
ref_(super); // still warns | ||
} | ||
} | ||
|
||
void autoref(T)(auto ref T t) {} | ||
void ref_(T)(ref T) {} |