Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/stable' into merge_stable
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Jul 1, 2024
2 parents b5130fd + 26564a6 commit 3c5d12b
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.109.1-rc.1
v2.109.1
7 changes: 7 additions & 0 deletions compiler/src/dmd/semantic2.d
Original file line number Diff line number Diff line change
Expand Up @@ -888,4 +888,11 @@ private extern(C++) final class StaticAAVisitor : SemanticTimeTransitiveVisitor

aaExp.lowering = loweredExp;
}

// https://issues.dlang.org/show_bug.cgi?id=24602
// TODO: Is this intionally not visited by SemanticTimeTransitiveVisitor?
override void visit(ClassReferenceExp crExp)
{
this.visit(crExp.value);
}
}
27 changes: 27 additions & 0 deletions compiler/test/runnable/staticaa.d
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,32 @@ void testStaticArray()

/////////////////////////////////////////////

// https://issues.dlang.org/show_bug.cgi?id=24602

class Set
{
bool[string] aa;

this(bool[string] aa)
{
this.aa = aa;
}
}

class Bar
{
Set x = new Set(["a": 1, "b": 0]);
}

void testClassLiteral()
{
assert(new Bar().x.aa["a"] == 1);
assert(new Bar().x.aa["b"] == 0);
}

/////////////////////////////////////////////


void main()
{
testSimple();
Expand All @@ -192,4 +218,5 @@ void main()
testLocalStatic();
testEnumInit();
testStaticArray();
testClassLiteral();
}
50 changes: 50 additions & 0 deletions druntime/src/core/sys/posix/sys/statvfs.d
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,57 @@ version (CRuntime_Glibc) {
int statvfs (const char * file, statvfs_t* buf);
int fstatvfs (int fildes, statvfs_t *buf);
}
}
else version (CRuntime_Musl)
{
struct statvfs_t
{
c_ulong f_bsize;
c_ulong f_frsize;
fsblkcnt_t f_blocks;
fsblkcnt_t f_bfree;
fsblkcnt_t f_bavail;
fsfilcnt_t f_files;
fsfilcnt_t f_ffree;
fsfilcnt_t f_favail;
static if (true /+__BYTE_ORDER == __LITTLE_ENDIAN+/)
{
c_ulong f_fsid;
byte[2*int.sizeof-c_long.sizeof] __padding;
}
else
{
byte[2*int.sizeof-c_long.sizeof] __padding;
c_ulong f_fsid;
}
c_ulong f_flag;
c_ulong f_namemax;
uint f_type;
int[5] __reserved;
}

enum FFlag
{
ST_RDONLY = 1, /* Mount read-only. */
ST_NOSUID = 2,
ST_NODEV = 4, /* Disallow access to device special files. */
ST_NOEXEC = 8, /* Disallow program execution. */
ST_SYNCHRONOUS = 16, /* Writes are synced at once. */
ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
ST_WRITE = 128, /* Write on file/directory/symlink. */
ST_APPEND = 256, /* Append-only file. */
ST_IMMUTABLE = 512, /* Immutable file. */
ST_NOATIME = 1024, /* Do not update access times. */
ST_NODIRATIME = 2048, /* Do not update directory access times. */
ST_RELATIME = 4096 /* Update atime relative to mtime/ctime. */

}

int statvfs (const char * file, statvfs_t* buf);
int fstatvfs (int fildes, statvfs_t *buf);

alias statvfs statvfs64;
alias fstatvfs fstatvfs64;
}
else version (NetBSD)
{
Expand Down

0 comments on commit 3c5d12b

Please sign in to comment.