Merge pull request #6764 from rracariu/master

Fix Issue 19396 - ScopeBuffer can't be used in betterC with inline
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2018-11-21 00:05:11 +01:00 committed by GitHub
commit a66435ea90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ module std.internal.scopebuffer;
import core.stdc.stdlib : realloc; import core.stdc.stdlib : realloc;
import std.traits; import std.traits;
import std.internal.attributes : betterC;
/************************************** /**************************************
* ScopeBuffer encapsulates using a local array as a temporary buffer. * ScopeBuffer encapsulates using a local array as a temporary buffer.
@ -128,7 +129,7 @@ if (isAssignable!T &&
this.bufLen = cast(uint) buf.length; this.bufLen = cast(uint) buf.length;
} }
@system unittest @system @betterC unittest
{ {
ubyte[10] tmpbuf = void; ubyte[10] tmpbuf = void;
auto sbuf = ScopeBuffer!ubyte(tmpbuf); auto sbuf = ScopeBuffer!ubyte(tmpbuf);
@ -289,7 +290,7 @@ if (isAssignable!T &&
} }
} }
@system unittest @system @betterC unittest
{ {
import core.stdc.stdio; import core.stdc.stdio;
import std.range; import std.range;
@ -350,7 +351,7 @@ if (isAssignable!T &&
} }
// const // const
@system unittest @system @betterC unittest
{ {
char[10] tmpbuf = void; char[10] tmpbuf = void;
auto textbuf = ScopeBuffer!char(tmpbuf); auto textbuf = ScopeBuffer!char(tmpbuf);
@ -377,14 +378,14 @@ auto scopeBuffer(T)(T[] tmpbuf)
} }
/// ///
@system unittest @system @betterC unittest
{ {
ubyte[10] tmpbuf = void; ubyte[10] tmpbuf = void;
auto sb = scopeBuffer(tmpbuf); auto sb = scopeBuffer(tmpbuf);
scope(exit) sb.free(); scope(exit) sb.free();
} }
@system unittest @system @betterC unittest
{ {
ScopeBuffer!(int*) b; ScopeBuffer!(int*) b;
int*[] s; int*[] s;