Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 15812 - static struct inside extern(C++) class cannot be us… #10782

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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