struct S { string str; }; S g_s; unittest { S s1; S s2; assert(s1 == s2); // Success assert(g_s == s1); // Failed } Is this expected? If so, may I know the reason? Thanks.