DIP25: make phobos work with it

This commit is contained in:
Walter Bright 2015-01-29 23:47:32 -08:00
parent 8969ae9d51
commit dc302d26a4
13 changed files with 91 additions and 91 deletions

View file

@ -136,7 +136,7 @@ ifneq (,$(filter cc% gcc% clang% icc% egcc%, $(CC)))
endif
# Set DFLAGS
DFLAGS=-I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -m$(MODEL) $(PIC)
DFLAGS=-I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -dip25 -m$(MODEL) $(PIC)
ifeq ($(BUILD),debug)
DFLAGS += -g -debug
else

View file

@ -293,7 +293,7 @@ template forward(args...)
@safe unittest
{
ref int foo(ref int a) { return a; }
ref int foo(return ref int a) { return a; }
ref int bar(Args)(auto ref Args args)
{
return foo(forward!args);

View file

@ -4610,7 +4610,7 @@ version(unittest)
{
int j;
__std_conv_S s;
ref __std_conv_S foo() @property {s.i = j; return s;}
ref __std_conv_S foo() return @property {s.i = j; return s;}
alias foo this;
}
static assert(is(__std_conv_SS : __std_conv_S));

View file

@ -745,7 +745,7 @@ public:
Params:
rhs = The $(LREF SysTime) to assign to this one.
+/
ref SysTime opAssign(const ref SysTime rhs) @safe pure nothrow
ref SysTime opAssign(const ref SysTime rhs) return @safe pure nothrow
{
_stdTime = rhs._stdTime;
_timezone = rhs._timezone;
@ -757,7 +757,7 @@ public:
Params:
rhs = The $(LREF SysTime) to assign to this one.
+/
ref SysTime opAssign(SysTime rhs) @safe pure nothrow
ref SysTime opAssign(SysTime rhs) return @safe pure nothrow
{
_stdTime = rhs._stdTime;
_timezone = rhs._timezone;
@ -12948,7 +12948,7 @@ private:
Params:
days = The number of days to add to this Date.
+/
ref Date _addDays(long days) @safe pure nothrow
ref Date _addDays(long days) return @safe pure nothrow
{
dayOfGregorianCal = cast(int)(dayOfGregorianCal + days);
return this;
@ -14223,7 +14223,7 @@ private:
Params:
seconds = The number of seconds to add to this TimeOfDay.
+/
ref TimeOfDay _addSeconds(long seconds) @safe pure nothrow
ref TimeOfDay _addSeconds(long seconds) return @safe pure nothrow
{
long hnsecs = convert!("seconds", "hnsecs")(seconds);
hnsecs += convert!("hours", "hnsecs")(_hour);
@ -17145,7 +17145,7 @@ private:
Params:
seconds = The number of seconds to add to this $(LREF DateTime).
+/
ref DateTime _addSeconds(long seconds) @safe pure nothrow
ref DateTime _addSeconds(long seconds) return @safe pure nothrow
{
long hnsecs = convert!("seconds", "hnsecs")(seconds);
hnsecs += convert!("hours", "hnsecs")(_tod._hour);

View file

@ -551,7 +551,7 @@ ulong getSize(in char[] name) @safe
{
return stat(path.tempCString(), buf);
}
static stat_t* ptrOfLocalVariable(ref stat_t buf) @trusted
static stat_t* ptrOfLocalVariable(return ref stat_t buf) @trusted
{
return &buf;
}

View file

@ -38,7 +38,7 @@ struct FullCaseEntry
ubyte n, size;// n number in batch, size - size of batch
ubyte entry_len;
@property auto value() const @trusted pure nothrow @nogc
@property auto value() const @trusted pure nothrow @nogc return
{
return seq[0..entry_len];
}

View file

@ -555,7 +555,7 @@ unittest
char c;
enum empty = false;
void popFront(){};
ref char front() @property
ref char front() return @property
{
return c;
}
@ -1856,8 +1856,8 @@ ElementType!R moveBack(R)(R r)
int payload = 5;
@property bool empty() { return false; }
@property TestRange save() { return this; }
@property ref int front() { return payload; }
@property ref int back() { return payload; }
@property ref int front() return { return payload; }
@property ref int back() return { return payload; }
void popFront() { }
void popBack() { }
}

View file

@ -2702,7 +2702,7 @@ struct LockingTextReader
/* Read a utf8 sequence from the file, removing the chars from the stream.
Returns an empty result when at EOF. */
private char[] takeFront(ref char[4] buf)
private char[] takeFront(return ref char[4] buf)
{
import std.utf : stride, UTFException;
{

View file

@ -1291,7 +1291,7 @@ unittest
int sharedF() shared { return 0; }
int x;
ref int refF() { return x; }
ref int refF() return { return x; }
int propertyF() @property { return 0; }
int nothrowF() nothrow { return 0; }
int nogcF() @nogc { return 0; }

View file

@ -870,7 +870,7 @@ unittest
static struct R
{
Tuple!(int, int) _front;
@property ref Tuple!(int, int) front() { return _front; }
@property ref Tuple!(int, int) front() return { return _front; }
@property bool empty() { return _front[0] >= 10; }
void popFront() { ++_front[0]; }
}

View file

@ -2099,7 +2099,7 @@ unittest // bugzilla 12923
pure
{
char[] toUTF8(out char[4] buf, dchar c) nothrow @nogc @safe
char[] toUTF8(return out char[4] buf, dchar c) nothrow @nogc @safe
in
{
assert(isValidDchar(c));
@ -2207,7 +2207,7 @@ string toUTF8(in dchar[] s) @trusted
/* =================== Conversion to UTF16 ======================= */
wchar[] toUTF16(ref wchar[2] buf, dchar c) nothrow @nogc @safe
wchar[] toUTF16(return ref wchar[2] buf, dchar c) nothrow @nogc @safe
in
{
assert(isValidDchar(c));

View file

@ -38,13 +38,13 @@ CFLAGS=-mn -6 -r
## Flags for dmd D compiler
DFLAGS=-O -release -w
DFLAGS=-O -release -w -dip25
#DFLAGS=-unittest -g
#DFLAGS=-unittest -cov -g
## Flags for compiling unittests
UDFLAGS=-O -w
UDFLAGS=-O -w -dip25
## C compiler

View file

@ -37,13 +37,13 @@ CFLAGS=/O2 /nologo /I"$(VCDIR)\INCLUDE" /I"$(SDKDIR)\Include"
## Flags for dmd D compiler
DFLAGS=-m$(MODEL) -O -release -w
DFLAGS=-m$(MODEL) -O -release -w -dip25
#DFLAGS=-m$(MODEL) -unittest -g
#DFLAGS=-m$(MODEL) -unittest -cov -g
## Flags for compiling unittests
UDFLAGS=-g -m$(MODEL) -O -w
UDFLAGS=-g -m$(MODEL) -O -w -dip25
## C compiler, linker, librarian