Skip to content

Commit 171aa05

Browse files
authored
Merge pull request #11264 from BorisCarvajal/fix20923
Fix Issue 20923 - Redefinition of 'size_t' is affecting TypeStruct fu… merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents 40e10b4 + 70a3fd5 commit 171aa05

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/dmd/clone.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ FuncDeclaration buildXtoHash(StructDeclaration sd, Scope* sc)
809809
* hash value will also contain the result of parent class's toHash().
810810
*/
811811
const(char)[] code =
812-
"size_t h = 0;" ~
812+
".object.size_t h = 0;" ~
813813
"foreach (i, T; typeof(p.tupleof))" ~
814814
// workaround https://issues.dlang.org/show_bug.cgi?id=17968
815815
" static if(is(T* : const(.object.Object)*)) " ~

test/compilable/test20923.d

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version (D_LP64)
2+
{
3+
alias size_t = uint;
4+
}
5+
else
6+
{
7+
alias size_t = ulong;
8+
}
9+
10+
struct S
11+
{
12+
real not_reproduceable_without_this_variable;
13+
}

0 commit comments

Comments
 (0)