Skip to content

Commit

Permalink
Merge pull request #10782 from WalterBright/fix15812
Browse files Browse the repository at this point in the history
fix Issue 15812 - static struct inside extern(C++) class cannot be us…
merged-on-behalf-of: Walter Bright <WalterBright@users.noreply.github.com>
  • Loading branch information
dlang-bot committed Feb 12, 2020
2 parents 1bacd62 + 143f827 commit 18f4027
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/dmd/typesem.d
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ extern(C++) Type typeSemantic(Type t, Loc loc, Scope* sc)
{
if (search_function(sd, Id.eq))
{
.error(loc, "%sAA key type `%s` should have `size_t toHash() const nothrow @safe` if `opEquals` defined", s, sd.toChars());
.error(loc, "%sAA key type `%s` should have `extern (D) size_t toHash() const nothrow @safe` if `opEquals` defined", s, sd.toChars());
}
else
{
Expand Down
12 changes: 6 additions & 6 deletions test/fail_compilation/fail12255.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ TEST_OUTPUT:
---
fail_compilation/fail12255.d(29): Error: AA key type `SC1` does not have `bool opEquals(ref const SC1) const`
fail_compilation/fail12255.d(30): Error: AA key type `SC2` does not support const equality
fail_compilation/fail12255.d(35): Error: AA key type `SD1` should have `size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(35): Error: AA key type `SD1` should have `extern (D) size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(36): Error: AA key type `SD2` supports const equality but doesn't support const hashing
fail_compilation/fail12255.d(40): Error: AA key type `SE1` should have `size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(40): Error: AA key type `SE1` should have `extern (D) size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(41): Error: AA key type `SE2` supports const equality but doesn't support const hashing
---
*/
Expand Down Expand Up @@ -93,9 +93,9 @@ TEST_OUTPUT:
---
fail_compilation/fail12255.d(108): Error: bottom of AA key type `SC1` does not have `bool opEquals(ref const SC1) const`
fail_compilation/fail12255.d(109): Error: bottom of AA key type `SC2` does not support const equality
fail_compilation/fail12255.d(110): Error: bottom of AA key type `SD1` should have `size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(110): Error: bottom of AA key type `SD1` should have `extern (D) size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(111): Error: bottom of AA key type `SD2` supports const equality but doesn't support const hashing
fail_compilation/fail12255.d(112): Error: bottom of AA key type `SE1` should have `size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(112): Error: bottom of AA key type `SE1` should have `extern (D) size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(113): Error: bottom of AA key type `SE2` supports const equality but doesn't support const hashing
---
*/
Expand All @@ -118,9 +118,9 @@ TEST_OUTPUT:
---
fail_compilation/fail12255.d(133): Error: bottom of AA key type `SC1` does not have `bool opEquals(ref const SC1) const`
fail_compilation/fail12255.d(134): Error: bottom of AA key type `SC2` does not support const equality
fail_compilation/fail12255.d(135): Error: bottom of AA key type `SD1` should have `size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(135): Error: bottom of AA key type `SD1` should have `extern (D) size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(136): Error: bottom of AA key type `SD2` supports const equality but doesn't support const hashing
fail_compilation/fail12255.d(137): Error: bottom of AA key type `SE1` should have `size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(137): Error: bottom of AA key type `SE1` should have `extern (D) size_t toHash() const nothrow @safe` if `opEquals` defined
fail_compilation/fail12255.d(138): Error: bottom of AA key type `SE2` supports const equality but doesn't support const hashing
---
*/
Expand Down

0 comments on commit 18f4027

Please sign in to comment.