-9bba772fa67c6864e551bc87097402f691d947d4
+cb1106ad5bea4293cd302b0ba1f3ce08905d40fe
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
// http://www.digitalmars.com/d/archives/digitalmars/D/announce/4374.html
// http://www.99-bottles-of-beer.net/language-d-1212.html
-// Displays the "99 bottles of beer" song at compile time,
+// Generates the "99 bottles of beer" song at compile time,
// using the template metaprograming facilities of D.
// No executable is generated. No libraries are used.
// Illustrates template default values, template string value parameters,
~ showHowMany!( maxbeers, " on the wall.");
}
-pragma(msg, beer!(99));
+enum expected = `99 bottles of beer on the wall,
+99 bottles of beer.
+Take one down and pass it around,
+98 bottles of beer on the wall.
+
+98 bottles of beer on the wall,
+98 bottles of beer.
+Take one down and pass it around,
+97 bottles of beer on the wall.
+
+97 bottles of beer on the wall,
+97 bottles of beer.
+Take one down and pass it around,
+96 bottles of beer on the wall.
+
+96 bottles of beer on the wall,
+96 bottles of beer.
+Take one down and pass it around,
+95 bottles of beer on the wall.
+
+95 bottles of beer on the wall,
+95 bottles of beer.
+Take one down and pass it around,
+94 bottles of beer on the wall.
+
+94 bottles of beer on the wall,
+94 bottles of beer.
+Take one down and pass it around,
+93 bottles of beer on the wall.
+
+93 bottles of beer on the wall,
+93 bottles of beer.
+Take one down and pass it around,
+92 bottles of beer on the wall.
+
+92 bottles of beer on the wall,
+92 bottles of beer.
+Take one down and pass it around,
+91 bottles of beer on the wall.
+
+91 bottles of beer on the wall,
+91 bottles of beer.
+Take one down and pass it around,
+90 bottles of beer on the wall.
+
+90 bottles of beer on the wall,
+90 bottles of beer.
+Take one down and pass it around,
+89 bottles of beer on the wall.
+
+89 bottles of beer on the wall,
+89 bottles of beer.
+Take one down and pass it around,
+88 bottles of beer on the wall.
+
+88 bottles of beer on the wall,
+88 bottles of beer.
+Take one down and pass it around,
+87 bottles of beer on the wall.
+
+87 bottles of beer on the wall,
+87 bottles of beer.
+Take one down and pass it around,
+86 bottles of beer on the wall.
+
+86 bottles of beer on the wall,
+86 bottles of beer.
+Take one down and pass it around,
+85 bottles of beer on the wall.
+
+85 bottles of beer on the wall,
+85 bottles of beer.
+Take one down and pass it around,
+84 bottles of beer on the wall.
+
+84 bottles of beer on the wall,
+84 bottles of beer.
+Take one down and pass it around,
+83 bottles of beer on the wall.
+
+83 bottles of beer on the wall,
+83 bottles of beer.
+Take one down and pass it around,
+82 bottles of beer on the wall.
+
+82 bottles of beer on the wall,
+82 bottles of beer.
+Take one down and pass it around,
+81 bottles of beer on the wall.
+
+81 bottles of beer on the wall,
+81 bottles of beer.
+Take one down and pass it around,
+80 bottles of beer on the wall.
+
+80 bottles of beer on the wall,
+80 bottles of beer.
+Take one down and pass it around,
+79 bottles of beer on the wall.
+
+79 bottles of beer on the wall,
+79 bottles of beer.
+Take one down and pass it around,
+78 bottles of beer on the wall.
+
+78 bottles of beer on the wall,
+78 bottles of beer.
+Take one down and pass it around,
+77 bottles of beer on the wall.
+
+77 bottles of beer on the wall,
+77 bottles of beer.
+Take one down and pass it around,
+76 bottles of beer on the wall.
+
+76 bottles of beer on the wall,
+76 bottles of beer.
+Take one down and pass it around,
+75 bottles of beer on the wall.
+
+75 bottles of beer on the wall,
+75 bottles of beer.
+Take one down and pass it around,
+74 bottles of beer on the wall.
+
+74 bottles of beer on the wall,
+74 bottles of beer.
+Take one down and pass it around,
+73 bottles of beer on the wall.
+
+73 bottles of beer on the wall,
+73 bottles of beer.
+Take one down and pass it around,
+72 bottles of beer on the wall.
+
+72 bottles of beer on the wall,
+72 bottles of beer.
+Take one down and pass it around,
+71 bottles of beer on the wall.
+
+71 bottles of beer on the wall,
+71 bottles of beer.
+Take one down and pass it around,
+70 bottles of beer on the wall.
+
+70 bottles of beer on the wall,
+70 bottles of beer.
+Take one down and pass it around,
+69 bottles of beer on the wall.
+
+69 bottles of beer on the wall,
+69 bottles of beer.
+Take one down and pass it around,
+68 bottles of beer on the wall.
+
+68 bottles of beer on the wall,
+68 bottles of beer.
+Take one down and pass it around,
+67 bottles of beer on the wall.
+
+67 bottles of beer on the wall,
+67 bottles of beer.
+Take one down and pass it around,
+66 bottles of beer on the wall.
+
+66 bottles of beer on the wall,
+66 bottles of beer.
+Take one down and pass it around,
+65 bottles of beer on the wall.
+
+65 bottles of beer on the wall,
+65 bottles of beer.
+Take one down and pass it around,
+64 bottles of beer on the wall.
+
+64 bottles of beer on the wall,
+64 bottles of beer.
+Take one down and pass it around,
+63 bottles of beer on the wall.
+
+63 bottles of beer on the wall,
+63 bottles of beer.
+Take one down and pass it around,
+62 bottles of beer on the wall.
+
+62 bottles of beer on the wall,
+62 bottles of beer.
+Take one down and pass it around,
+61 bottles of beer on the wall.
+
+61 bottles of beer on the wall,
+61 bottles of beer.
+Take one down and pass it around,
+60 bottles of beer on the wall.
+
+60 bottles of beer on the wall,
+60 bottles of beer.
+Take one down and pass it around,
+59 bottles of beer on the wall.
+
+59 bottles of beer on the wall,
+59 bottles of beer.
+Take one down and pass it around,
+58 bottles of beer on the wall.
+
+58 bottles of beer on the wall,
+58 bottles of beer.
+Take one down and pass it around,
+57 bottles of beer on the wall.
+
+57 bottles of beer on the wall,
+57 bottles of beer.
+Take one down and pass it around,
+56 bottles of beer on the wall.
+
+56 bottles of beer on the wall,
+56 bottles of beer.
+Take one down and pass it around,
+55 bottles of beer on the wall.
+
+55 bottles of beer on the wall,
+55 bottles of beer.
+Take one down and pass it around,
+54 bottles of beer on the wall.
+
+54 bottles of beer on the wall,
+54 bottles of beer.
+Take one down and pass it around,
+53 bottles of beer on the wall.
+
+53 bottles of beer on the wall,
+53 bottles of beer.
+Take one down and pass it around,
+52 bottles of beer on the wall.
+
+52 bottles of beer on the wall,
+52 bottles of beer.
+Take one down and pass it around,
+51 bottles of beer on the wall.
+
+51 bottles of beer on the wall,
+51 bottles of beer.
+Take one down and pass it around,
+50 bottles of beer on the wall.
+
+50 bottles of beer on the wall,
+50 bottles of beer.
+Take one down and pass it around,
+49 bottles of beer on the wall.
+
+49 bottles of beer on the wall,
+49 bottles of beer.
+Take one down and pass it around,
+48 bottles of beer on the wall.
+
+48 bottles of beer on the wall,
+48 bottles of beer.
+Take one down and pass it around,
+47 bottles of beer on the wall.
+
+47 bottles of beer on the wall,
+47 bottles of beer.
+Take one down and pass it around,
+46 bottles of beer on the wall.
+
+46 bottles of beer on the wall,
+46 bottles of beer.
+Take one down and pass it around,
+45 bottles of beer on the wall.
+
+45 bottles of beer on the wall,
+45 bottles of beer.
+Take one down and pass it around,
+44 bottles of beer on the wall.
+
+44 bottles of beer on the wall,
+44 bottles of beer.
+Take one down and pass it around,
+43 bottles of beer on the wall.
+
+43 bottles of beer on the wall,
+43 bottles of beer.
+Take one down and pass it around,
+42 bottles of beer on the wall.
+
+42 bottles of beer on the wall,
+42 bottles of beer.
+Take one down and pass it around,
+41 bottles of beer on the wall.
+
+41 bottles of beer on the wall,
+41 bottles of beer.
+Take one down and pass it around,
+40 bottles of beer on the wall.
+
+40 bottles of beer on the wall,
+40 bottles of beer.
+Take one down and pass it around,
+39 bottles of beer on the wall.
+
+39 bottles of beer on the wall,
+39 bottles of beer.
+Take one down and pass it around,
+38 bottles of beer on the wall.
+
+38 bottles of beer on the wall,
+38 bottles of beer.
+Take one down and pass it around,
+37 bottles of beer on the wall.
+
+37 bottles of beer on the wall,
+37 bottles of beer.
+Take one down and pass it around,
+36 bottles of beer on the wall.
+
+36 bottles of beer on the wall,
+36 bottles of beer.
+Take one down and pass it around,
+35 bottles of beer on the wall.
+
+35 bottles of beer on the wall,
+35 bottles of beer.
+Take one down and pass it around,
+34 bottles of beer on the wall.
+
+34 bottles of beer on the wall,
+34 bottles of beer.
+Take one down and pass it around,
+33 bottles of beer on the wall.
+
+33 bottles of beer on the wall,
+33 bottles of beer.
+Take one down and pass it around,
+32 bottles of beer on the wall.
+
+32 bottles of beer on the wall,
+32 bottles of beer.
+Take one down and pass it around,
+31 bottles of beer on the wall.
+
+31 bottles of beer on the wall,
+31 bottles of beer.
+Take one down and pass it around,
+30 bottles of beer on the wall.
+
+30 bottles of beer on the wall,
+30 bottles of beer.
+Take one down and pass it around,
+29 bottles of beer on the wall.
+
+29 bottles of beer on the wall,
+29 bottles of beer.
+Take one down and pass it around,
+28 bottles of beer on the wall.
+
+28 bottles of beer on the wall,
+28 bottles of beer.
+Take one down and pass it around,
+27 bottles of beer on the wall.
+
+27 bottles of beer on the wall,
+27 bottles of beer.
+Take one down and pass it around,
+26 bottles of beer on the wall.
+
+26 bottles of beer on the wall,
+26 bottles of beer.
+Take one down and pass it around,
+25 bottles of beer on the wall.
+
+25 bottles of beer on the wall,
+25 bottles of beer.
+Take one down and pass it around,
+24 bottles of beer on the wall.
+
+24 bottles of beer on the wall,
+24 bottles of beer.
+Take one down and pass it around,
+23 bottles of beer on the wall.
+
+23 bottles of beer on the wall,
+23 bottles of beer.
+Take one down and pass it around,
+22 bottles of beer on the wall.
+
+22 bottles of beer on the wall,
+22 bottles of beer.
+Take one down and pass it around,
+21 bottles of beer on the wall.
+
+21 bottles of beer on the wall,
+21 bottles of beer.
+Take one down and pass it around,
+20 bottles of beer on the wall.
+
+20 bottles of beer on the wall,
+20 bottles of beer.
+Take one down and pass it around,
+19 bottles of beer on the wall.
+
+19 bottles of beer on the wall,
+19 bottles of beer.
+Take one down and pass it around,
+18 bottles of beer on the wall.
+
+18 bottles of beer on the wall,
+18 bottles of beer.
+Take one down and pass it around,
+17 bottles of beer on the wall.
+
+17 bottles of beer on the wall,
+17 bottles of beer.
+Take one down and pass it around,
+16 bottles of beer on the wall.
+
+16 bottles of beer on the wall,
+16 bottles of beer.
+Take one down and pass it around,
+15 bottles of beer on the wall.
+
+15 bottles of beer on the wall,
+15 bottles of beer.
+Take one down and pass it around,
+14 bottles of beer on the wall.
+
+14 bottles of beer on the wall,
+14 bottles of beer.
+Take one down and pass it around,
+13 bottles of beer on the wall.
+
+13 bottles of beer on the wall,
+13 bottles of beer.
+Take one down and pass it around,
+12 bottles of beer on the wall.
+
+12 bottles of beer on the wall,
+12 bottles of beer.
+Take one down and pass it around,
+11 bottles of beer on the wall.
+
+11 bottles of beer on the wall,
+11 bottles of beer.
+Take one down and pass it around,
+10 bottles of beer on the wall.
+
+10 bottles of beer on the wall,
+10 bottles of beer.
+Take one down and pass it around,
+9 bottles of beer on the wall.
+
+9 bottles of beer on the wall,
+9 bottles of beer.
+Take one down and pass it around,
+8 bottles of beer on the wall.
+
+8 bottles of beer on the wall,
+8 bottles of beer.
+Take one down and pass it around,
+7 bottles of beer on the wall.
+
+7 bottles of beer on the wall,
+7 bottles of beer.
+Take one down and pass it around,
+6 bottles of beer on the wall.
+
+6 bottles of beer on the wall,
+6 bottles of beer.
+Take one down and pass it around,
+5 bottles of beer on the wall.
+
+5 bottles of beer on the wall,
+5 bottles of beer.
+Take one down and pass it around,
+4 bottles of beer on the wall.
+
+4 bottles of beer on the wall,
+4 bottles of beer.
+Take one down and pass it around,
+3 bottles of beer on the wall.
+
+3 bottles of beer on the wall,
+3 bottles of beer.
+Take one down and pass it around,
+2 bottles of beer on the wall.
+
+2 bottles of beer on the wall,
+2 bottles of beer.
+Take one down and pass it around,
+1 bottle of beer on the wall.
+
+1 bottle of beer on the wall,
+1 bottle of beer.
+Take one down and pass it around,
+no more bottles of beer on the wall.
+
+No more bottles of beer on the wall,
+no more bottles of beer.
+Go to the store and buy some more,
+99 bottles of beer on the wall.
+`;
+
+static assert(beer!(99) == expected);
// REQUIRED_ARGS: -c
+/*
+TEST_OUTPUT:
+---
+&this
+---
+*/
struct S0 {
void foo() {
pragma(msg, &this);
+/*
+TEST_OUTPUT:
+---
+compilable/b17111.d(16): Deprecation: `case` variables have to be `const` or `immutable`
+compilable/b17111.d(17): Deprecation: `case` variables have to be `const` or `immutable`
+---
+*/
alias TestType = ubyte;
void test()
**************************************************/
version(all)
- pragma(msg, "true");
+ pragma(inline, true);
else
- pragma(msg, "false");
+ pragma(inline, false);
/**************************************************
2438
void bug8982(ref const int v = 7){}
static if (is(typeof(bug8982) P == __parameters)) {
- pragma(msg, ((P[0..1] g) => g[0])());
+ enum eval8982 = ((P[0..1] g) => g[0])();
}
}
try
{
}
- catch
+ catch(.object.Throwable)
{
}
}
**************************************************/
template A(B) {
- pragma(msg, "missing ;")
+ pragma(lib, "missing ;")
enum X = 0;
}
/***************************************************/
// 13236
-pragma(msg, is(typeof({ struct S { S x; } })));
+enum bug13286 = is(typeof({ struct S { S x; } }));
/***************************************************/
// 13280
struct Tup14166(T...) { T field; alias field this; }
Tup14166!(int, int) tup14166;
Tup14166!(int, int) makeTup14166() { return tup14166; }
-
-pragma(msg, typeof((s14166.x += 1) = 2)); // ok <- error
-pragma(msg, typeof(s14166.a.length += 2)); // ok <- error
-pragma(msg, typeof(s14166++)); // ok <- error
-pragma(msg, typeof(s14166.x ^^ 2)); // ok <- error
-pragma(msg, typeof(s14166.y ^^= 2.5)); // ok <- error
-pragma(msg, typeof(makeAA14166()[0] = 1)); // ok <- error
-pragma(msg, typeof(tup14166.field = makeTup14166())); // ok <- error
+alias TT14166(T...) = T;
+
+static assert(is(typeof((s14166.x += 1) = 2) == int)); // ok <- error
+static assert(is(typeof(s14166.a.length += 2) == size_t)); // ok <- error
+static assert(is(typeof(s14166++) == S14166)); // ok <- error
+static assert(is(typeof(s14166.x ^^ 2) == int)); // ok <- error
+static assert(is(typeof(s14166.y ^^= 2.5) == double)); // ok <- error
+static assert(is(typeof(makeAA14166()[0] = 1) == X14166)); // ok <- error
+static assert(is(typeof(tup14166.field = makeTup14166()) == TT14166!(int, int))); // ok <- error
/***************************************************/
// 14388
// EXTRA_SOURCES: extra-files/ddoc3.ddoc
// PERMUTE_ARGS:
// REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -o-
-// POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh 3
+// POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh
/**
* Summary
+++ /dev/null
-module imports.test15117a;
-
-struct AssertResult {}
-
-auto test_usr_1()
-{
- // 2. generate TyepInfoStructDeclaration
- auto x = typeid(AssertResult);
-}
-// PERMUTE_ARGS: -inline
+// PERMUTE_ARGS: -inline
+/*
+TEST_OUTPUT:
+---
+compilable/interpret3.d(2914): Deprecation: `case` variables have to be `const` or `immutable`
+compilable/interpret3.d(6351): Deprecation: identity comparison of static arrays implicitly coerces them to slices, which are compared by reference
+---
+*/
template compiles(int T)
{
interface J : I {} // comment out to let compilation succeed
struct A { }
-pragma(msg, moduleName!A);
+static assert(moduleName!A == "b");
interface I {}
@system:
alias Fun = void function() @safe;
- pragma (msg, Fun.stringof);
static assert(Fun.stringof == "void function() @safe");
alias Del = void delegate() @safe;
- pragma (msg, Del.stringof);
static assert(Del.stringof == "void delegate() @safe");
string definePostfixAliases(string type)
{
return "alias " ~ type ~ "!byte " ~ type ~ "b;\n"
-"alias " ~ type ~ "!ubyte " ~ type ~ "ub;\n"
-"alias " ~ type ~ "!short " ~ type ~ "s;\n"
-"alias " ~ type ~ "!ushort " ~ type ~ "us;\n"
-"alias " ~ type ~ "!int " ~ type ~ "i;\n"
-"alias " ~ type ~ "!uint " ~ type ~ "ui;\n"
-"alias " ~ type ~ "!long " ~ type ~ "l;\n"
-"alias " ~ type ~ "!ulong " ~ type ~ "ul;\n"
-"alias " ~ type ~ "!float " ~ type ~ "f;\n"
-"alias " ~ type ~ "!double " ~ type ~ "d;\n";
+~ "alias " ~ type ~ "!ubyte " ~ type ~ "ub;\n"
+~ "alias " ~ type ~ "!short " ~ type ~ "s;\n"
+~ "alias " ~ type ~ "!ushort " ~ type ~ "us;\n"
+~ "alias " ~ type ~ "!int " ~ type ~ "i;\n"
+~ "alias " ~ type ~ "!uint " ~ type ~ "ui;\n"
+~ "alias " ~ type ~ "!long " ~ type ~ "l;\n"
+~ "alias " ~ type ~ "!ulong " ~ type ~ "ul;\n"
+~ "alias " ~ type ~ "!float " ~ type ~ "f;\n"
+~ "alias " ~ type ~ "!double " ~ type ~ "d;\n";
}
// define a lot of type names
+++ /dev/null
-// REQUIRED_ARGS: -o-
-// PERMUTE_ARGS:
-// EXTRA_SOURCES: imports/test15117a.d
-
-import users = imports.test15117a;
-
-void RunApiTest(T...)()
-{
- foreach (name; __traits(allMembers, users))
- {
- // 3. list the name of TyepInfoStructDeclaration,
- // but it's just internal symbol and invisible.
- mixin("alias func = users . " ~ name ~ ";");
- }
-}
-
-void main()
-{
- // 1. run semantic3 of users.test_usr_1
- users.test_usr_1();
-
- RunApiTest!();
-}
{
static if ((void*).sizeof == 8)
{
- pragma(msg, "64");
+ int pointersize = 64;
}
else
{
- pragma(msg, "32");
+ int pointersize = 32;
}
version (X86_64)
{
- pragma(msg, "X86_64");
+ string arch = "X86_64";
}
else
{
- pragma(msg, "Not 64");
+ string arch = "Not 64";
}
}
void test()
{
- pragma(msg, templ!(D.memvar));
- pragma(msg, templ!(CPP.memvar));
- // root cause, C++ member variables have no mangling
- pragma(msg, CPP.memvar.mangleof);
+ static assert(templ!(D.memvar) == 1234);
+ static assert(templ!(CPP.memvar) == 1234);
+ // ICE: root cause, C++ member variables have no mangling
+ enum CPPmemvar = CPP.memvar.mangleof;
}
import std.typecons : tuple;
enum foo = tuple(1, 2).expand;
-pragma(msg, typeof(foo).stringof);
-pragma(msg, foo.stringof);
+static assert(typeof(foo).stringof == "(int, int)");
+static assert(foo.stringof == "tuple(1, 2)");
static import pkgDIP37.datetime;
static assert(!__traits(compiles, def()));
pkgDIP37.datetime.def();
- pkgDIP37.datetime.common.def();
}
// https://issues.dlang.org/show_bug.cgi?id=17629
void bar()() { a[1] = 2; }
bar();
- pragma(msg, typeof(bar!())); // nothrow @safe void()
+ static assert(typeof(bar!()).stringof == "pure nothrow @nogc @safe void()"); // nothrow @safe void()
}
pure void test10296()
{
func13840(); // throwable function call
}
}
- catch
+ catch(Throwable)
{}
}
// EXTRA_SOURCES: extra-files/header1.d
// REQUIRED_ARGS: -o- -unittest -H -Hf${RESULTS_DIR}/compilable/header1.di
// PERMUTE_ARGS: -d -dw
-// POST_SCRIPT: compilable/extra-files/header-postscript.sh header1
+// POST_SCRIPT: compilable/extra-files/header-postscript.sh
+/*
+TEST_OUTPUT:
+---
+Hello World
+---
+*/
void main() {}
// EXTRA_SOURCES: extra-files/header1.d
// REQUIRED_ARGS: -o- -H -Hf${RESULTS_DIR}/compilable/header1i.di -inline
// PERMUTE_ARGS: -d -dw
-// POST_SCRIPT: compilable/extra-files/header-postscript.sh header1i
+// POST_SCRIPT: compilable/extra-files/header-postscript.sh
+/*
+TEST_OUTPUT:
+---
+Hello World
+---
+*/
void main() {}
/***************************************************/
// 6719
-pragma(msg, __traits(compiles, mixin("(const(A))[0..0]")));
+static assert(__traits(compiles, mixin("(const(A))[0..0]")) == false);
/***************************************************/
// 9232
-// REQUIRED_ARGS:
+/*
+TEST_OUTPUT:
+---
+fail_compilation/bug5.d(8): Error: function `bug5.test1` no `return exp;` or `assert(0);` at end of function
+---
+*/
int test1()
{
-// REQUIRED_ARGS:
+/*
+TEST_OUTPUT:
+---
+fail_compilation/bug5b.d(8): Error: function `bug5b.test1` has no `return` statement, but is expected to return a value of type `int`
+---
+*/
int test1()
{
-// Bugzilla 8150: nothrow check doesn't work for constructor
+// https://issues.dlang.org/show_bug.cgi?id=8150: nothrow check doesn't work for constructor
+/*
+TEST_OUTPUT:
+---
+fail_compilation/bug8150a.d(14): Error: `object.Exception` is thrown but not caught
+fail_compilation/bug8150a.d(12): Error: `nothrow` constructor `bug8150a.Foo.this` may throw
+---
+*/
struct Foo
{
-// Bugzilla 8150: nothrow check doesn't work for constructor
+// https://issues.dlang.org/show_bug.cgi?id=8150: nothrow check doesn't work for constructor
+/*
+TEST_OUTPUT:
+---
+fail_compilation/bug8150b.d(15): Error: `object.Exception` is thrown but not caught
+fail_compilation/bug8150b.d(13): Error: `nothrow` constructor `bug8150b.Foo.__ctor!().this` may throw
+fail_compilation/bug8150b.d(20): Error: template instance `bug8150b.Foo.__ctor!()` error instantiating
+---
+*/
struct Foo
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/diag10327.d(11): Error: module `test10327` is in file 'imports/test10327.d' which cannot be read
+import path[0] = fail_compilation
+import path[1] = $p:druntime/import$
+import path[2] = $p:phobos$
+---
+*/
+
import imports.test10327; // package.d missing
/*
+TEST_OUTPUT:
---
fail_compilation/diag15713.d(18): Error: no property 'widthSign' for type 'Data'
fail_compilation/diag15713.d(38): Error: template instance test.conwritefImpl!("parse-int", "width", "\x0a", Data()) error instantiating
// Issue 76 - Using a non-template struct as a template
// Compiling leads to "Assertion failure: 's->parent' on line 1694 in file
// 'template.c'"
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail104.d(26): Error: template instance `P!()` `P` is not a template declaration, it is a alias
+fail_compilation/fail104.d(26): Error: mixin `fail104.C!(S).C.T!()` is not defined
+fail_compilation/fail104.d(31): Error: template instance `fail104.C!(S)` error instantiating
+---
+*/
struct S
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail10905.d(20): Error: incompatible types for `(this.x) == (cast(const(__vector(long[2])))cast(__vector(long[2]))1L)`: both operands are of type `const(__vector(long[2]))`
+---
+*/
struct Foo
{
-// Issue 402 - compiler crash with mixin and forward reference
+// https://issues.dlang.org/show_bug.cgi?id=402
+// compiler crash with mixin and forward reference
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail115.d(17): Error: mixin `Foo!y` cannot resolve forward reference
+---
+*/
template Foo(alias b)
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail11503a.d(24): Error: cannot implicitly convert expression `makes()` of type `immutable(S)*` to `S*`
+---
+*/
struct S
{
immutable(S)* s;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail11503b.d(17): Error: cannot implicitly convert expression `makes()` of type `immutable(int[])` to `int[]`
+---
+*/
immutable int[] x = [1, 2, 3];
auto makes() pure
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail11503c.d(19): Error: cannot implicitly convert expression `d.filename()` of type `const(char)[]` to `string`
+---
+*/
struct Data
{
char[256] buffer;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail11503d.d(26): Error: cannot implicitly convert expression `filename(d)` of type `const(char)[]` to `string`
+fail_compilation/fail11503d.d(27): Error: cannot implicitly convert expression `filename2(& d)` of type `const(char)[]` to `string`
+---
+*/
struct Data2
{
char buffer;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail12.d(17): Error: function `fail12.main.Foo!(y).abc` at fail_compilation/fail12.d(9) conflicts with function `fail12.main.Foo!(y).abc` at fail_compilation/fail12.d(9)
+---
+*/
template Foo(alias b)
{
int abc() { return b; }
// PERMUTE_ARGS: -d -dw
// segfault on DMD0.150, never failed if use typeid() instead.
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail121.d(23): Error: no property `typeinfo` for type `fail121.myobject`
+fail_compilation/fail121.d(23): Error: no property `typeinfo` for type `int`
+---
+*/
struct myobject
{
+++ /dev/null
-void dorecursive()
-{
- recursive!"ratherLongSymbolNameToHitTheMaximumSymbolLengthEarlierThanTheTemplateRecursionLimit_";
-}
-
-void recursive(string name)()
-{
- struct S {} // define type to kick off mangler
- static if (name.length <= (4 << 20))
- recursive!(name ~ name);
-}
-
+++ /dev/null
-// 751 Compiler segfault on template expansion
-
- template TypeTuple( TList... )
- {
- alias TList TypeTuple;
- }
-
- template IndexOf( T, TList... )
- {
- static if( TList.length == 0 )
- const size_t IndexOf = 1;
- else static if( is( T == typeof( TList[0] ) ) )
- const size_t IndexOf = 0;
- else
- const size_t IndexOf = 1 + IndexOf!( T, (TList[1 .. $]) );
- }
-
- void main()
- {
- TypeTuple!(int, long) T;
- printf( "%u\n", IndexOf!(long, T) );
- }
-
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail14.d(10): Error: template instance `fail14.A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!(A!int))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))` recursive expansion exceeded allowed nesting limit
+---
+*/
class A(T)
{
// REQUIRED_ARGS: -o-
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail14486.d(56): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(56): Error: `delete c0` is not `@safe` but is used in `@safe` function `test1a`
+fail_compilation/fail14486.d(57): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(57): Error: `pure` function `fail14486.test1a` cannot call impure destructor `fail14486.C1a.~this`
+fail_compilation/fail14486.d(57): Error: `@safe` function `fail14486.test1a` cannot call `@system` destructor `fail14486.C1a.~this`
+fail_compilation/fail14486.d(43): `fail14486.C1a.~this` is declared here
+fail_compilation/fail14486.d(57): Error: `@nogc` function `fail14486.test1a` cannot call non-@nogc destructor `fail14486.C1a.~this`
+fail_compilation/fail14486.d(62): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(63): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(63): Error: destructor `fail14486.C1b.~this` is not `nothrow`
+fail_compilation/fail14486.d(60): Error: `nothrow` function `fail14486.test1b` may throw
+fail_compilation/fail14486.d(68): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(68): Error: `delete s0` is not `@safe` but is used in `@safe` function `test2a`
+fail_compilation/fail14486.d(69): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(69): Error: `pure` function `fail14486.test2a` cannot call impure destructor `fail14486.S1a.~this`
+fail_compilation/fail14486.d(69): Error: `@safe` function `fail14486.test2a` cannot call `@system` destructor `fail14486.S1a.~this`
+fail_compilation/fail14486.d(49): `fail14486.S1a.~this` is declared here
+fail_compilation/fail14486.d(69): Error: `@nogc` function `fail14486.test2a` cannot call non-@nogc destructor `fail14486.S1a.~this`
+fail_compilation/fail14486.d(74): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(75): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(75): Error: destructor `fail14486.S1b.~this` is not `nothrow`
+fail_compilation/fail14486.d(72): Error: `nothrow` function `fail14486.test2b` may throw
+fail_compilation/fail14486.d(80): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(80): Error: `delete a0` is not `@safe` but is used in `@safe` function `test3a`
+fail_compilation/fail14486.d(81): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(81): Error: `pure` function `fail14486.test3a` cannot call impure destructor `fail14486.S1a.~this`
+fail_compilation/fail14486.d(81): Error: `@safe` function `fail14486.test3a` cannot call `@system` destructor `fail14486.S1a.~this`
+fail_compilation/fail14486.d(49): `fail14486.S1a.~this` is declared here
+fail_compilation/fail14486.d(81): Error: `@nogc` function `fail14486.test3a` cannot call non-@nogc destructor `fail14486.S1a.~this`
+fail_compilation/fail14486.d(86): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(87): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/fail14486.d(87): Error: destructor `fail14486.S1b.~this` is not `nothrow`
+fail_compilation/fail14486.d(84): Error: `nothrow` function `fail14486.test3b` may throw
+---
+*/
+
class C0a { }
class C1a { ~this() {} }
class C2a { ~this() {} @nogc pure @safe delete(void* p) {} }
/*
+TEST_OUTPUT:
+---
+fail_compilation/fail15.d(24): Error: cannot use `[]` operator on expression of type `void`
+---
+*/
+/*
Segfault on DMD 0.095
http://www.digitalmars.com/d/archives/digitalmars/D/bugs/926.html
*/
/*
REQUIRED_ARGS: -v
+TEST_OUTPUT:
---
fail_compilation/fail15616b.d(43): Error: none of the overloads of 'foo' are callable using argument types (double), candidates are:
fail_compilation/fail15616b.d(16): fail15616b.foo(int a)
// ICE(template.c) in DMD0.080
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail16.d(19): Error: function declaration without return type. (Note that constructors are always named `this`)
+fail_compilation/fail16.d(19): Error: no identifier for declarator `bar!(typeof(X))(X)`
+---
+*/
int i;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail17.d(11): Error: undefined identifier `B`
+fail_compilation/fail17.d(11): Error: mixin `fail17.A!int.A.B!(T, A!T)` is not defined
+fail_compilation/fail17.d(14): Error: template instance `fail17.A!int` error instantiating
+---
+*/
struct A(T)
{
mixin B!(T, A!(T));
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail196.d(26): Error: delimited string must end in )"
+fail_compilation/fail196.d(26): Error: Implicit string concatenation is error-prone and disallowed in D
+fail_compilation/fail196.d(26): Use the explicit syntax instead (concatenating literals is `@nogc`): "foo(xxx)" ~ ";\x0a assert(s == "
+fail_compilation/fail196.d(27): Error: semicolon expected, not `foo`
+fail_compilation/fail196.d(27): Error: found `");\x0a\x0a s = q"` when expecting `;` following statement
+fail_compilation/fail196.d(29): Error: found `";\x0a assert(s == "` when expecting `;` following statement
+fail_compilation/fail196.d(30): Error: found `");\x0a\x0a s = q"` when expecting `;` following statement
+fail_compilation/fail196.d(32): Error: found `{` when expecting `;` following statement
+fail_compilation/fail196.d(32): Error: found `}` when expecting `;` following statement
+fail_compilation/fail196.d(33): Error: found `foo` when expecting `;` following statement
+fail_compilation/fail196.d(33): Error: found `}` when expecting `;` following statement
+fail_compilation/fail196.d(35): Error: found `<` when expecting `;` following statement
+fail_compilation/fail196.d(36): Error: found `foo` when expecting `;` following statement
+fail_compilation/fail196.d(36): Error: found `<` instead of statement
+fail_compilation/fail196.d(42): Error: unterminated string constant starting at fail_compilation/fail196.d(42)
+fail_compilation/fail196.d(44): Error: found `End of File` when expecting `}` following compound statement
+fail_compilation/fail196.d(44): Error: found `End of File` when expecting `}` following compound statement
+---
+*/
void main()
{
// PERMUTE_ARGS:
/*
+TEST_OUTPUT:
---
fail_compilation/fail19890a.d(8): Error: `void[/^[0-9]+(LU)?$/]` size 1 * /^[0-9]+$/ exceeds 0x7fffffff size limit for static array
---
// PERMUTE_ARGS:
/*
+TEST_OUTPUT:
---
fail_compilation/fail19890b.d(8): Error: `void[/^[0-9]+(LU)?$/]` size 1 * /^[0-9]+$/ exceeds 0x7fffffff size limit for static array
---
// REQUIRED_ARGS: -de
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail199.d(20): Deprecation: class `fail199.DepClass` is deprecated
+fail_compilation/fail199.d(20): Deprecation: class `fail199.DepClass` is deprecated
+---
+*/
//import std.stdio;
// REQUIRED_ARGS: -de
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail200.d(17): Deprecation: interface `fail200.DepClass` is deprecated
+fail_compilation/fail200.d(17): Deprecation: interface `fail200.DepClass` is deprecated
+---
+*/
//import std.stdio;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail201.d(10): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail201.d(10): Error: shift by 33 is outside the range `0..31`
+---
+*/
void main() {
int c;
c = c >>> 33;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail202.d(10): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail202.d(10): Error: shift by 33 is outside the range `0..31`
+---
+*/
void main() {
int c;
c = c >> 33;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail203.d(10): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail203.d(10): Error: shift by 33 is outside the range `0..31`
+---
+*/
void main() {
int c;
c = c << 33;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail204.d(9): Error: shift assign by 65 is outside the range `0..63`
+---
+*/
void main() {
long c;
c >>= 65;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail205.d(9): Error: shift assign by 65 is outside the range `0..63`
+---
+*/
void main() {
long c;
c <<= 65;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail206.d(9): Error: shift assign by 65 is outside the range `0..63`
+---
+*/
void main() {
long c;
c >>>= 65;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail217.d(22): Error: mutable method `fail217.Message.this` is not callable using a `immutable` object
+fail_compilation/fail217.d(13): Consider adding `const` or `inout` here
+---
+*/
class Message
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail220.d(12): Error: identifier expected for template value parameter
+fail_compilation/fail220.d(12): Error: found `==` when expecting `)`
+fail_compilation/fail220.d(12): Error: found `class` when expecting `)`
+fail_compilation/fail220.d(12): Error: declaration expected, not `)`
+fail_compilation/fail220.d(16): Error: unrecognized declaration
+---
+*/
template types (T) {
static if (is (T V : V[K], K == class)) {
static assert (false, "assoc");
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail225.d(15): Error: cannot implicitly convert expression `1` of type `int` to `immutable(char*)`
+fail_compilation/fail225.d(15): Error: cannot implicitly convert expression `& ch` of type `char*` to `immutable(char*)`
+---
+*/
struct Struct {
char* chptr;
}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail232.d(15): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail232.d(15): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail232.d(16): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail232.d(16): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail232.d(17): Error: shift by 33 is outside the range `0..31`
+fail_compilation/fail232.d(17): Error: shift by 33 is outside the range `0..31`
+---
+*/
void bug1601() {
int i;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail239.d(8): Error: type `F` is not an expression
+---
+*/
class F { int x; }
alias typeof(F).x b;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail252.d(13): Error: cannot implicitly override base class method `fail252.Timer.Task.run` with `fail252.Timer.__anonclass1.run`; add `override` attribute
+---
+*/
class Timer {
abstract class Task {
public abstract void run();
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail257.d(8): Error: incompatible types for `("foo"d) == ("bar"c)`: `dstring` and `string`
+fail_compilation/fail257.d(8): while evaluating `pragma(msg, "foo"d == "bar"c ? "A" : "B")`
+---
+*/
pragma(msg, "foo"d == "bar"c ? "A" : "B");
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail258.d(11): Error: delimiter cannot be whitespace
+fail_compilation/fail258.d(11): Error: delimited string must end in
+"
+fail_compilation/fail258.d(11): Error: declaration expected, not `"X"`
+fail_compilation/fail258.d(14): Error: unterminated string constant starting at fail_compilation/fail258.d(14)
+---
+*/
q"
X
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail2740.d(17): Error: class `fail2740.Foo` ambiguous virtual function `foo`
+---
+*/
interface IFoo
{
int foo();
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail276.d(19): Error: `this` has no effect
+fail_compilation/fail276.d(15): Error: `this` is only defined in non-static member functions, not `__anonclass2`
+---
+*/
class C
{
-// Issue 2920 - recursive templates blow compiler stack
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail279.d(14): Error: mixin `fail279.Template!0.Template!1.Template!2.Template!3.Template!4.Template!5.Template!6.Template!7.Template!8.Template!9.Template!10.Template!11.Template!12.Template!13.Template!14.Template!15.Template!16.Template!17.Template!18.Template!19.Template!20.Template!21.Template!22.Template!23.Template!24.Template!25.Template!26.Template!27.Template!28.Template!29.Template!30.Template!31.Template!32.Template!33.Template!34.Template!35.Template!36.Template!37.Template!38.Template!39.Template!40.Template!41.Template!42.Template!43.Template!44.Template!45.Template!46.Template!47.Template!48.Template!49.Template!50.Template!51.Template!52.Template!53.Template!54.Template!55.Template!56.Template!57.Template!58.Template!59.Template!60.Template!61.Template!62.Template!63.Template!64.Template!65.Template!66.Template!67.Template!68.Template!69.Template!70.Template!71.Template!72.Template!73.Template!74.Template!75.Template!76.Template!77.Template!78.Template!79.Template!80.Template!81.Template!82.Template!83.Template!84.Template!85.Template!86.Template!87.Template!88.Template!89.Template!90.Template!91.Template!92.Template!93.Template!94.Template!95.Template!96.Template!97.Template!98.Template!99.Template!100.Template!101.Template!102.Template!103.Template!104.Template!105.Template!106.Template!107.Template!108.Template!109.Template!110.Template!111.Template!112.Template!113.Template!114.Template!115.Template!116.Template!117.Template!118.Template!119.Template!120.Template!121.Template!122.Template!123.Template!124.Template!125.Template!126.Template!127.Template!128.Template!129.Template!130.Template!131.Template!132.Template!133.Template!134.Template!135.Template!136.Template!137.Template!138.Template!139.Template!140.Template!141.Template!142.Template!143.Template!144.Template!145.Template!146.Template!147.Template!148.Template!149.Template!150.Template!151.Template!152.Template!153.Template!154.Template!155.Template!156.Template!157.Template!158.Template!159.Template!160.Template!161.Template!162.Template!163.Template!164.Template!165.Template!166.Template!167.Template!168.Template!169.Template!170.Template!171.Template!172.Template!173.Template!174.Template!175.Template!176.Template!177.Template!178.Template!179.Template!180.Template!181.Template!182.Template!183.Template!184.Template!185.Template!186.Template!187.Template!188.Template!189.Template!190.Template!191.Template!192.Template!193.Template!194.Template!195.Template!196.Template!197.Template!198.Template!199.Template!200.Template!201.Template!202.Template!203.Template!204.Template!205.Template!206.Template!207.Template!208.Template!209.Template!210.Template!211.Template!212.Template!213.Template!214.Template!215.Template!216.Template!217.Template!218.Template!219.Template!220.Template!221.Template!222.Template!223.Template!224.Template!225.Template!226.Template!227.Template!228.Template!229.Template!230.Template!231.Template!232.Template!233.Template!234.Template!235.Template!236.Template!237.Template!238.Template!239.Template!240.Template!241.Template!242.Template!243.Template!244.Template!245.Template!246.Template!247.Template!248.Template!249.Template!250.Template!251.Template!252.Template!253.Template!254.Template!255.Template!256.Template!257.Template!258.Template!259.Template!260.Template!261.Template!262.Template!263.Template!264.Template!265.Template!266.Template!267.Template!268.Template!269.Template!270.Template!271.Template!272.Template!273.Template!274.Template!275.Template!276.Template!277.Template!278.Template!279.Template!280.Template!281.Template!282.Template!283.Template!284.Template!285.Template!286.Template!287.Template!288.Template!289.Template!290.Template!291.Template!292.Template!293.Template!294.Template!295.Template!296.Template!297.Template!298.Template!299.Template!300.Template!301.Template!302.Template!303.Template!304.Template!305.Template!306.Template!307.Template!308.Template!309.Template!310.Template!311.Template!312.Template!313.Template!314.Template!315.Template!316.Template!317.Template!318.Template!319.Template!320.Template!321.Template!322.Template!323.Template!324.Template!325.Template!326.Template!327.Template!328.Template!329.Template!330.Template!331.Template!332.Template!333.Template!334.Template!335.Template!336.Template!337.Template!338.Template!339.Template!340.Template!341.Template!342.Template!343.Template!344.Template!345.Template!346.Template!347.Template!348.Template!349.Template!350.Template!351.Template!352.Template!353.Template!354.Template!355.Template!356.Template!357.Template!358.Template!359.Template!360.Template!361.Template!362.Template!363.Template!364.Template!365.Template!366.Template!367.Template!368.Template!369.Template!370.Template!371.Template!372.Template!373.Template!374.Template!375.Template!376.Template!377.Template!378.Template!379.Template!380.Template!381.Template!382.Template!383.Template!384.Template!385.Template!386.Template!387.Template!388.Template!389.Template!390.Template!391.Template!392.Template!393.Template!394.Template!395.Template!396.Template!397.Template!398.Template!399.Template!400.Template!401.Template!402.Template!403.Template!404.Template!405.Template!406.Template!407.Template!408.Template!409.Template!410.Template!411.Template!412.Template!413.Template!414.Template!415.Template!416.Template!417.Template!418.Template!419.Template!420.Template!421.Template!422.Template!423.Template!424.Template!425.Template!426.Template!427.Template!428.Template!429.Template!430.Template!431.Template!432.Template!433.Template!434.Template!435.Template!436.Template!437.Template!438.Template!439.Template!440.Template!441.Template!442.Template!443.Template!444.Template!445.Template!446.Template!447.Template!448.Template!449.Template!450.Template!451.Template!452.Template!453.Template!454.Template!455.Template!456.Template!457.Template!458.Template!459.Template!460.Template!461.Template!462.Template!463.Template!464.Template!465.Template!466.Template!467.Template!468.Template!469.Template!470.Template!471.Template!472.Template!473.Template!474.Template!475.Template!476.Template!477.Template!478.Template!479.Template!480.Template!481.Template!482.Template!483.Template!484.Template!485.Template!486.Template!487.Template!488.Template!489.Template!490.Template!491.Template!492.Template!493.Template!494.Template!495.Template!496.Template!497.Template!498.Template!499.Template!500` recursive expansion
+---
+*/
+
+// https://issues.dlang.org/show_bug.cgi?id=2920
+// recursive templates blow compiler stack
// template_16
template Template(int i)
-// Issue 2920 - recursive templates blow compiler stack
+// https://issues.dlang.org/show_bug.cgi?id=2920
+// recursive templates blow compiler stack
// template_17_A.
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail280.d(13): Error: template instance `fail280.t!500` recursive expansion exceeded allowed nesting limit
+---
+*/
template t(int i)
{
-// Issue 2920 - recursive templates blow compiler stack
+// https://issues.dlang.org/show_bug.cgi?id=2920
+// recursive templates blow compiler stack
// template_29_B.
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail281.d(15): Error: template instance `fail281.foo!4294966795u` recursive expansion exceeded allowed nesting limit
+---
+*/
template foo(uint i)
{
// REQUIRED_ARGS: -unittest
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail308.d(18): Error: template instance `object.RTInfo!(TestType)` recursive expansion
+---
+*/
void main()
{
// REQUIRED_ARGS: -de
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3150.d(10): Error: cannot cast expression `[1, 2]` of type `int[]` to `ulong`
+---
+*/
void main() {
ulong u = cast(ulong)[1,2];
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail316.d(17): Error: mixin `fail316.foo.BadImpl!(uint, Mix1)` cannot resolve forward reference
+---
+*/
template BadImpl(T, alias thename)
{
void a_bad_idea(T t)
/*
-test_output:
+TEST_OUTPUT:
---
fail_compilation/fail324.d(16): Error: template instance doStuff!((i){ return i; }) cannot use local '__lambda1' as parameter to non-global template doStuff(alias fun)()
---
-// 3290
+// https://issues.dlang.org/show_bug.cgi?id=3290
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3290.d(12): Error: argument type mismatch, `const(int)` to `ref int`
+---
+*/
void main()
{
-// 3737
+// https://issues.dlang.org/show_bug.cgi?id=3737
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail344.d(20): Error: undefined identifier `Q`
+fail_compilation/fail344.d(20): Error: undefined identifier `Q`
+fail_compilation/fail344.d(20): Error: undefined identifier `V`
+fail_compilation/fail344.d(23): while evaluating: `static assert(Alike!(SIB!(crayon)))`
+fail_compilation/fail344.d(23): Error: template instance `fail344.SIB!(crayon).SIB.Alike!(SIB!(crayon))` error instantiating
+fail_compilation/fail344.d(23): while evaluating: `static assert(Alike!(SIB!(crayon)))`
+fail_compilation/fail344.d(28): Error: template instance `fail344.SIB!(crayon).SIB.opDispatch!"E"` error instantiating
+---
+*/
int crayon;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail346.d(15): Error: undefined identifier `P`
+fail_compilation/fail346.d(15): Error: variable `fail346.S.T!0.T` cannot use template to add field to aggregate `S`
+fail_compilation/fail346.d(20): Error: template instance `fail346.S.T!0` error instantiating
+fail_compilation/fail346.d(23): instantiated from here: `V!(S, 0)`
+---
+*/
struct S {
int x;
+/*
+EXTRA_FILES: imports/fail356.d
+TEST_OUTPUT:
+---
+fail_compilation/fail356a.d(9): Error: variable `fail356a.imports` conflicts with import `fail356a.imports` at fail_compilation/fail356a.d(8)
+---
+*/
import imports.fail356;
int imports; // collides with package name
+/*
+EXTRA_FILES: imports/fail356.d
+TEST_OUTPUT:
+---
+fail_compilation/fail356b.d(9): Error: variable `fail356b.bar` conflicts with alias `fail356b.bar` at fail_compilation/fail356b.d(8)
+---
+*/
import imports.fail356 : bar;
int bar; // collides with selective import
+/*
+EXTRA_FILES: imports/fail356.d
+TEST_OUTPUT:
+---
+fail_compilation/fail356c.d(9): Error: variable `fail356c.foo` conflicts with import `fail356c.foo` at fail_compilation/fail356c.d(8)
+---
+*/
import foo = imports.fail356;
int foo; // collides with renamed import
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3581a.d(9): Error: function `fail3581a.B.f` cannot override a non-virtual function
+---
+*/
class A { void f() {} }
class B : A { static override void f() {}; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3581b.d(9): Error: function `fail3581b.B.f` `private` method is not virtual and cannot override
+---
+*/
class A { void f() {} }
class B : A { private override void f() {}; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail359.d(8): Error: #line integer ["filespec"]\n expected
+fail_compilation/fail359.d(9): Error: no identifier for declarator `_BOOM`
+---
+*/
#line 5 _BOOM
void main() { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3673a.d(8): Error: template constraints only allowed for templates
+---
+*/
class A {}
class B : A if(false) { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3673b.d(12): Error: basic type expected, not `if`
+fail_compilation/fail3673b.d(12): Error: template constraints only allowed for templates
+fail_compilation/fail3673b.d(12): Error: { } expected following `class` declaration
+fail_compilation/fail3673b.d(12): Error: no identifier for declarator `A`
+fail_compilation/fail3673b.d(12): Error: declaration expected, not `{`
+---
+*/
class A {}
class B : if(false) A { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3731.d(13): Error: cannot implicitly convert expression `x` of type `immutable(D)` to `fail3731.main.C`
+---
+*/
void main()
{
/*
+TEST_OUTPUT:
---
Error: cannot mix core.std.stdlib.alloca() and exception handling in _Dmain()
---
-import std.stdio;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail3895.d(12): Error: cannot append type `double[]` to type `float[]`
+---
+*/
+
void main() {
double[] stuff = [1.,2.,3.,4.,5.];
float[] otherStuff;
otherStuff ~= stuff;
- writeln(otherStuff);
}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4206.d(9): Error: initializer must be an expression, not `s`
+---
+*/
struct s {}
enum var = s;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4269a.d(12): Error: undefined identifier `B`
+fail_compilation/fail4269a.d(12): Error: variable `fail4269a.A.blah` field not allowed in interface
+fail_compilation/fail4269a.d(13): Error: undefined identifier `B`
+---
+*/
enum bool WWW = is(typeof(A.x));
interface A {
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4269b.d(11): Error: undefined identifier `B`
+fail_compilation/fail4269b.d(12): Error: undefined identifier `B`
+---
+*/
enum bool WWW = is(typeof(A.x));
struct A {
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4269c.d(11): Error: undefined identifier `B`
+fail_compilation/fail4269c.d(12): Error: undefined identifier `B`
+---
+*/
enum bool WWW = is(typeof(A.x));
class A {
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4269d.d(9): Error: undefined identifier `Y`
+---
+*/
static if(is(typeof(X6.init))) {}
alias Y X6;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4269e.d(10): Error: semicolon expected, not `X5`
+fail_compilation/fail4269e.d(10): Error: no identifier for declarator `X5`
+---
+*/
static if(is(typeof(X5.init))) {}
typedef Y X5;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4269f.d(9): Error: `alias X16 = X16;` cannot alias itself, use a qualified name to create an overload set
+---
+*/
static if(is(typeof(X16))) {}
alias X16 X16;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4269g.d(10): Error: alias `fail4269g.Xg` cannot alias an expression `d[1]`
+---
+*/
int[2] d;
static if(is(typeof(Xg.init))) {}
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375a.d(14): Warning: else is dangling, add { } after condition at fail_compilation/fail4375a.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375b.d(16): Warning: else is dangling, add { } after condition at fail_compilation/fail4375b.d(12)
+---
+*/
void main() {
// disallowed
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375c.d(15): Warning: else is dangling, add { } after condition at fail_compilation/fail4375c.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375d.d(15): Warning: else is dangling, add { } after condition at fail_compilation/fail4375d.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375e.d(14): Warning: else is dangling, add { } after condition at fail_compilation/fail4375e.d(11)
+---
+*/
void main() {
version (A)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375f.d(14): Warning: else is dangling, add { } after condition at fail_compilation/fail4375f.d(11)
+---
+*/
void main() {
version (A)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375g.d(14): Warning: else is dangling, add { } after condition at fail_compilation/fail4375g.d(11)
+---
+*/
void main() {
static if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375h.d(16): Warning: else is dangling, add { } after condition at fail_compilation/fail4375h.d(13)
+---
+*/
void main() {
switch (4) {
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375i.d(16): Warning: else is dangling, add { } after condition at fail_compilation/fail4375i.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375j.d(16): Warning: else is dangling, add { } after condition at fail_compilation/fail4375j.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375k.d-mixin-11(15): Warning: else is dangling, add { } after condition at fail_compilation/fail4375k.d-mixin-11(12)
+---
+*/
void main() {
mixin(q{
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375l.d(15): Warning: else is dangling, add { } after condition at fail_compilation/fail4375l.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375m.d(15): Warning: else is dangling, add { } after condition at fail_compilation/fail4375m.d(12)
+---
+*/
void main() {
do
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375o.d(15): Warning: else is dangling, add { } after condition at fail_compilation/fail4375o.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375p.d(19): Warning: else is dangling, add { } after condition at fail_compilation/fail4375p.d(12)
+fail_compilation/fail4375p.d(16): Error: undefined identifier `x`
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375q.d(17): Warning: else is dangling, add { } after condition at fail_compilation/fail4375q.d(13)
+fail_compilation/fail4375q.d(14): Error: `with` expressions must be aggregate types or pointers to them, not `int`
+---
+*/
void main() {
auto x = 1;
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375r.d(17): Warning: else is dangling, add { } after condition at fail_compilation/fail4375r.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375s.d(17): Warning: else is dangling, add { } after condition at fail_compilation/fail4375s.d(11)
+---
+*/
void main() {
if (true)
// REQUIRED_ARGS: -w -unittest
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375t.d(14): Warning: else is dangling, add { } after condition at fail_compilation/fail4375t.d(11)
+---
+*/
unittest { // disallowed
if (true)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375u.d(13): Warning: else is dangling, add { } after condition at fail_compilation/fail4375u.d(11)
+---
+*/
static if (true)
static if (false)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375v.d(13): Warning: else is dangling, add { } after condition at fail_compilation/fail4375v.d(11)
+---
+*/
version (A)
version (B)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375w.d(13): Warning: else is dangling, add { } after condition at fail_compilation/fail4375w.d(11)
+---
+*/
static if (true)
version (B)
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375x.d(14): Warning: else is dangling, add { } after condition at fail_compilation/fail4375x.d(11)
+---
+*/
static if (true)
abstract:
// REQUIRED_ARGS: -w
-// 4375: Dangling else
+// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4375y.d(16): Warning: else is dangling, add { } after condition at fail_compilation/fail4375y.d(11)
+---
+*/
static if (true)
align(1)
-// 4510
+// https://issues.dlang.org/show_bug.cgi?id=4510
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4510.d(12): Error: argument type mismatch, `float` to `ref double`
+---
+*/
void main()
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4511.d(18): Error: cannot implicitly override base class method `fail4511.test72.X.func` with `fail4511.test72.Y.func`; add `override` attribute
+---
+*/
void test72()
{
class A {}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4517.d(16): Error: `enum` member `B` not represented in `final switch`
+---
+*/
enum E : ushort
{
/*
+TEST_OUTPUT:
---
fail_compilation/fail4611.d(15): Error: Vec[2147483647] size 4 * 2147483647 exceeds 0x7fffffff size limit for static array
---
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail47.d(8): Error: variable `fail47._foo` is aliased to a function
+---
+*/
void foo() {}
int _foo;
alias _foo foo;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail4958.d(8): Error: enum member `fail4958.FloatEnum.B` has inexact value due to loss of precision
+---
+*/
enum FloatEnum : float { A = float.max/2, B, C }
-// 5435
+// https://issues.dlang.org/show_bug.cgi?id=5435
+/*
+TEST_OUTPUT:
+---
+Enum5435.A
+Enum5435.B
+Enum5435.C
+fail_compilation/fail5435.d(38): Error: cannot implicitly convert expression `"foo"` of type `string` to `Enum5435`
+fail_compilation/fail5435.d(38): while evaluating `pragma(msg, foo)`
+fail_compilation/fail5435.d(38): Error: cannot implicitly convert expression `3.0` of type `double` to `Enum5435`
+fail_compilation/fail5435.d(38): while evaluating `pragma(msg, foo)`
+fail_compilation/fail5435.d(39): Error: cannot implicitly convert expression `Enum5435.A` of type `Enum5435` to `string`
+fail_compilation/fail5435.d(39): while evaluating `pragma(msg, foo)`
+fail_compilation/fail5435.d(39): Error: cannot implicitly convert expression `Enum5435.B` of type `Enum5435` to `string`
+fail_compilation/fail5435.d(39): while evaluating `pragma(msg, foo)`
+fail_compilation/fail5435.d(39): Error: cannot implicitly convert expression `Enum5435.C` of type `Enum5435` to `string`
+fail_compilation/fail5435.d(39): while evaluating `pragma(msg, foo)`
+foo
+fail_compilation/fail5435.d(39): Error: cannot implicitly convert expression `3.0` of type `double` to `string`
+fail_compilation/fail5435.d(39): while evaluating `pragma(msg, foo)`
+0
+1
+2
+fail_compilation/fail5435.d(40): Error: cannot implicitly convert expression `"foo"` of type `string` to `int`
+fail_compilation/fail5435.d(40): while evaluating `pragma(msg, foo)`
+fail_compilation/fail5435.d(40): Error: cannot implicitly convert expression `3.0` of type `double` to `int`
+fail_compilation/fail5435.d(40): while evaluating `pragma(msg, foo)`
+---
+*/
template Tuple5435(E...) { alias E Tuple5435; }
enum Enum5435 { A, B, C };
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail56.d(21): Error: mixin `dstress.nocompile.bug_20050330_A.main.Blah!(5, a).Blah!(5, a)` recursive mixin instantiation
+fail_compilation/fail56.d(26): Error: mixin `dstress.nocompile.bug_20050330_A.main.Blah!(5, a)` error instantiating
+---
+*/
// $HeadURL$
// $Date$
// $Author$
+/*
+TEST_OUTPUT:
+----
+fail_compilation/fail5634.d(9): Error: function `D main()` conflicts with previous declaration at fail_compilation/fail5634.d(8)
+---
+*/
+
void main() { }
void main() { }
-
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail57.d(11): Error: divide by 0
+fail_compilation/fail57.d(11): Error: divide by 0
+---
+*/
int main()
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail5733.d(12): Error: `opDispatch!"foo"` isn't a template
+---
+*/
struct Test
{
struct opDispatch(string dummy)
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail58.d(26): Error: function `fail58.SomeFunc(dchar[] pText, out int pStopPosn)` is not callable using argument types `(string, int)`
+fail_compilation/fail58.d(26): cannot pass argument `"123"` of type `string` to parameter `dchar[] pText`
+fail_compilation/fail58.d(30): Error: function `fail58.SomeFunc(dchar[] pText, out int pStopPosn)` is not callable using argument types `(string, int)`
+fail_compilation/fail58.d(30): cannot pass argument `""` of type `string` to parameter `dchar[] pText`
+---
+*/
debug(1) import std.stdio;
const int anything = -1000; // Line #2
dchar[] SomeFunc( dchar[] pText, out int pStopPosn)
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail5851.d(11): Error: alias this is not reachable as `Foo` already converts to `object.Object`
+---
+*/
class Foo
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail5953a1.d(9): Error: expression expected, not `,`
+---
+*/
void main()
{
auto a2 = [,]; // invalid, but compiles
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail5953a2.d(11): Error: expression expected, not `,`
+fail_compilation/fail5953a2.d(11): Error: expression expected, not `,`
+fail_compilation/fail5953a2.d(11): Error: expression expected, not `,`
+---
+*/
void main()
{
auto a3 = [,,,]; // invalid, but compiles
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail5953s1.d(10): Error: expression expected, not `,`
+---
+*/
void main()
{
struct S{}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail5953s2.d(12): Error: expression expected, not `,`
+fail_compilation/fail5953s2.d(12): Error: expression expected, not `,`
+fail_compilation/fail5953s2.d(12): Error: expression expected, not `,`
+---
+*/
void main()
{
struct S{}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail60.d(14): Error: `this` is only defined in non-static member functions, not `A`
+---
+*/
class A
{
class B
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6029.d(10): Error: alias this is not reachable as `A` already converts to `A`
+---
+*/
struct A
{
static A a;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6242.d(9): Error: cannot implicitly override base class method `fail6242.A.fun` with `fail6242.B.fun`; add `override` attribute
+---
+*/
class A { void fun(int) {} }
class B : A { void fun(int x) in { assert(x > 0); } body {} }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6458.d(10): Error: Invalid trailing code unit
+---
+*/
void main()
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6497.d(12): Error: cannot take address of local `n` in `@safe` function `main`
+fail_compilation/fail6497.d(12): Error: cannot take address of local `n` in `@safe` function `main`
+---
+*/
void main() @safe
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6561.d(9): Error: undefined identifier `x`
+---
+*/
struct S
{
alias x this; // should cause undefined identifier error
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6611.d(11): Error: cannot post-increment array slice `x[]`, use pre-increment instead
+---
+*/
void main()
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6781.d(9): Error: undefined identifier `some_error`
+fail_compilation/fail6781.d(14): Error: template instance `fail6781.C6781.makeSortedIndices.bug6781!(greater)` error instantiating
+---
+*/
void bug6781(alias xxx)() {
some_error;
}
-// 6968
+// https://issues.dlang.org/show_bug.cgi?id=6968
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail6968.d(26): Error: cannot pass type `int` as a function argument
+fail_compilation/fail6968.d(26): Error: cannot pass type `long` as a function argument
+fail_compilation/fail6968.d(26): Error: circular initialization of variable `fail6968.PredAny!(int, long, float).PredAny`
+fail_compilation/fail6968.d(31): Error: template instance `fail6968.PredAny!(int, long, float)` error instantiating
+fail_compilation/fail6968.d(31): while evaluating `pragma(msg, PredAny!(int, long, float))`
+---
+*/
template Pred(A, B)
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7173.d(23): Error: expression `b1._a.opBinary(b2._a).fun()` is `void` and has no value
+---
+*/
struct A{
A opBinary(string op)(A a){ A rt; return rt; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7178.d(10): Error: undefined identifier `contents` in module `fail7178`
+fail_compilation/fail7178.d(12): Error: mixin `fail7178.populate!int` error instantiating
+---
+*/
template populate(overloads...)
{
mixin populate!(.contents);
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7234.d(14): Error: no property `empty` for type `Contract*`, perhaps `import std.range;` is needed?
+---
+*/
struct Contract {
void opDispatch()(){}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7369.d(9): Error: cannot modify `this.a` in `const` function
+---
+*/
struct S7369 {
int a;
invariant() { a += 5; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424b.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424b
{
@property int g()() { return 0; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424c.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424c
{
@property int g()() { return 0; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424d.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424d
{
@property int g()() immutable { return 0; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424e.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424e
{
@property int g()() immutable { return 0; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424f.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424f
{
@property int g()() shared { return 0; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424g.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424g
{
@property int g()() { return 0; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424h.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424g
{
@property int g()() { return 0; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7424i.d(10): Error: cannot resolve type for this.g()()
+---
+*/
struct S7424g
{
@property int g()() immutable { return 0; }
-
-// 7524
+/*
+REQUIRED_ARGS: -o-
+TEST_OUTPUT:
+----
+fail_compilation/fail7524a.d(10): Error: #line integer ["filespec"]\n expected
+fail_compilation/fail7524a.d(10): Error: declaration expected, not `"$r:\w+ +\d+ \d+$"`
+----
+*/
#line 47 __DATE__
-// 7524
+// https://issues.dlang.org/show_bug.cgi?id=7524
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7524b.d(10): Error: #line integer ["filespec"]\n expected
+fail_compilation/fail7524b.d(10): Error: declaration expected, not `$n$L`
+---
+*/
#line 47 __VERSION__
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7603a.d(7): Error: cannot modify constant `true`
+---
+*/
void test(ref bool val = true) { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7603b.d(7): Error: cannot modify constant `true`
+---
+*/
void test(out bool val = true) { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7603c.d(8): Error: cannot modify constant `3`
+---
+*/
enum x = 3;
void test(ref int val = x) { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail77.d(11): Error: cannot cast expression `& i` of type `int*` to `ubyte[4]`
+---
+*/
void test()
{
int i;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7702.d(14): Error: `s.opDispatch!"x"` isn't a template
+---
+*/
struct S
{
template opDispatch (string name) {}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7751.d(15): Error: no constructor for `Foo`
+fail_compilation/fail7751.d(23): Error: template instance `fail7751.foo!int` error instantiating
+---
+*/
class Foo(T)
{
T x;
-// 7851
+// https://issues.dlang.org/show_bug.cgi?id=7851
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_0` of type `int`
+fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_1` of type `long`
+fail_compilation/fail7851.d(38): Error: need `this` for `__mem_field_2` of type `float`
+---
+*/
template TypeTuple(TList...)
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7859.d(9): Error: undefined identifier `NonExistent`
+---
+*/
template A(alias B) {}
mixin template C(alias B = cast(NonExistent)null) {
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail7861.d(17): Error: no property `nonexistent` for type `test.B`
+---
+*/
module test;
mixin template A() {
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail8009.d(9): Error: template `fail8009.filter` cannot deduce function from argument types `!()(void)`, candidates are:
+fail_compilation/fail8009.d(8): `filter(R)(scope bool delegate(ref BAD!R) func)`
+---
+*/
void filter(R)(scope bool delegate(ref BAD!R) func) { }
void main() { filter(r => r); }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail8032.d(19): Error: function `fail8032.B.f` cannot determine overridden function
+---
+*/
mixin template T()
{
void f() { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail8313.d(13): Error: `fail8313.bar` called with argument types `(int)` matches both:
+fail_compilation/fail8313.d(11): `fail8313.bar!().bar(int x)`
+and:
+fail_compilation/fail8313.d(12): `fail8313.bar!().bar(int x)`
+fail_compilation/fail8313.d(13): while evaluating: `static assert(bar()(int x)(1))`
+---
+*/
auto bar()(int x){return x;}
auto bar()(int x = bar()){return x;}
static assert(bar(1));
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail8691.d(7): Error: struct `fail8691.Foo` cannot have field `f` with static array of same struct type
+---
+*/
struct Foo
{
Foo[1] f;
/*
-REQUIRED_ARGS: -o-
-PERMUTE_ARGS:
+REQUIRED_ARGS: -m64 -o-
+TEST_OUTPUT:
+---
+fail_compilation/fail9301.d(11): Error: cannot implicitly convert expression `0` of type `int` to `__vector(void[16])`
+---
*/
void main()
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail94.d(28): Error: cannot implicitly override base class method `fail94.A.clone` with `fail94.B.clone`; add `override` attribute
+---
+*/
interface I
{
int foo();
// PREMUTE_ARGS:
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail9613.d(12): Error: `(arguments)` expected following `const(byte)`
+fail_compilation/fail9613.d(12): Error: semicolon expected following auto declaration, not `.`
+---
+*/
void main()
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/failinout1.d(9): Error: cannot modify `inout` expression `x`
+---
+*/
inout(int) foo(inout(int) x)
{
x = 5; // cannot modify inout
+/*
+TEST_OUTPUT:
+---
+fail_compilation/failinout2.d(7): Error: variable `failinout2.x` only parameters or stack based variables can be `inout`
+---
+*/
inout int x;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/failinout3748a.d(9): Error: variable `failinout3748a.S3748.err8` only parameters or stack based variables can be `inout`
+---
+*/
struct S3748
{
inout(int) err8;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/failinout3748b.d(9): Error: variable `failinout3748b.main.err11` `inout` variables can only be declared inside `inout` functions
+---
+*/
void main()
{
inout(int)* err11;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/failsafea.d(14): Error: `@safe` function `failsafea.callingsystem` cannot call `@system` function `failsafea.systemfunc`
+fail_compilation/failsafea.d(9): `failsafea.systemfunc` is declared here
+---
+*/
void systemfunc() @system {}
+/*
+TEST_OUTPUT:
+---
+fail_compilation/failsafeb.d(13): Error: `@safe` function `failsafeb.callingsystem` cannot call `@system` function pointer `sysfuncptr`
+---
+*/
void function() @system sysfuncptr;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/failsafec.d(13): Error: `@safe` function `failsafec.callingsystem` cannot call `@system` delegate `sysdelegate`
+---
+*/
void delegate() @system sysdelegate;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fix350a.d(12): Error: comma expected separating field initializers
+fail_compilation/fix350a.d(12): Error: comma expected separating field initializers
+---
+*/
struct S1
{
int a, b, c;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fix350b.d(15): Error: comma expected separating field initializers
+fail_compilation/fix350b.d(15): Error: comma expected separating field initializers
+fail_compilation/fix350b.d(16): Error: comma expected separating field initializers
+---
+*/
int foo() { return 3; }
struct S2
-// 10273 - ICE in CTFE
+// https://issues.dlang.org/show_bug.cgi?id=10273
+// ICE in CTFE
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice10273.d(14): Error: cannot implicitly convert expression `3.45` of type `double` to `int`
+fail_compilation/ice10273.d(13): Error: CTFE failed because of previous errors in `Bug10273.init`
+fail_compilation/ice10273.d(22): called from here: `bug10273()`
+fail_compilation/ice10273.d(22): while evaluating: `static assert(bug10273())`
+---
+*/
struct Bug10273 {
int val = 3.45;
-// 10283
+// https://issues.dlang.org/show_bug.cgi?id=10283
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice10283.d(14): Error: cannot implicitly convert expression `7` of type `int` to `string`
+---
+*/
S10283 blah(S10283 xxx) { return xxx; }
S10283 repy = blah(S10283());
-// 10599 ICE(interpret.c)
+// https://issues.dlang.org/show_bug.cgi?id=10599
+// ICE(interpret.c)
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice10599.d(13): Error: cannot implicitly convert expression `3.45` of type `double` to `int`
+fail_compilation/ice10599.d(21): called from here: `bug10599()`
+fail_compilation/ice10599.d(21): while evaluating: `static assert(bug10599())`
+---
+*/
struct Bug {
int val = 3.45;
return 1;
}
-static assert(bug10599());
\ No newline at end of file
+static assert(bug10599());
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice11963.d(10): Error: unexpected `(` in declarator
+fail_compilation/ice11963.d(10): Error: identifier expected for template type parameter
+fail_compilation/ice11963.d(10): Error: no identifier for declarator `A`
+fail_compilation/ice11963.d(10): Error: declaration expected, not `""`
+---
+*/
A("")=
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice11965.d(15): Error: no identifier for declarator `b*`
+fail_compilation/ice11965.d(15): Error: found `End of File` when expecting `}` following compound statement
+fail_compilation/ice11965.d(15): Error: found `End of File` when expecting `]`
+fail_compilation/ice11965.d(15): Error: no identifier for declarator `u[()
+{
+b* A;
+}
+]`
+---
+*/
u[{b*A,
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice11967.d(12): Error: use `@(attributes)` instead of `[attributes]`
+fail_compilation/ice11967.d(12): Error: expression expected, not `%`
+fail_compilation/ice11967.d(12): Error: found `g` when expecting `)`
+fail_compilation/ice11967.d(12): Error: found `{` when expecting `]`
+fail_compilation/ice11967.d(13): Error: `@identifier` or `@(ArgumentList)` expected, not `@End of File`
+fail_compilation/ice11967.d(13): Error: declaration expected following attribute, not end of file
+---
+*/
[F(%g{@
+/*
+TEST_OUTPUT:
+----
+fail_compilation/ice11968.d(9): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+fail_compilation/ice11968.d(9): Error: cannot modify string literal `"fail_compilation$?:windows=\\|/$ice11968.d"`
+----
+*/
+
void main() { delete __FILE__ ; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice11974.d(7): Error: cannot modify constant `0`
+---
+*/
void main() { 0 = __LINE__ ^^ [ 0 ] ; }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice11982.d(16): Error: basic type expected, not `scope`
+fail_compilation/ice11982.d(16): Error: found `scope` when expecting `;` following statement
+fail_compilation/ice11982.d(16): Error: basic type expected, not `}`
+fail_compilation/ice11982.d(16): Error: missing `{ ... }` for function literal
+fail_compilation/ice11982.d(16): Error: C style cast illegal, use `cast(funk)function _error_()
+{
+}
+`
+fail_compilation/ice11982.d(16): Error: found `}` when expecting `;` following statement
+fail_compilation/ice11982.d(17): Error: found `End of File` when expecting `}` following compound statement
+---
+*/
void main() { new scope ( funk ) function }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice12673.d(13): Error: static assert: `__traits(compiles, () pure nothrow @nogc @safe
+{
+__error__
+}
+)` is false
+---
+*/
void main()
{
static assert(__traits(compiles, { abcd(); }));
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice13644.d(22): Error: foreach: key cannot be of non-integral type `string`
+---
+*/
struct Tuple(T...)
{
// REQUIRED_ARGS: -o-
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice15855.d(25): Error: found `End of File` when expecting `(`
+fail_compilation/ice15855.d(25): Error: found `End of File` instead of statement
+fail_compilation/ice15855.d(25): Error: expression expected, not `End of File`
+fail_compilation/ice15855.d(25): Error: found `End of File` when expecting `;` following `for` condition
+fail_compilation/ice15855.d(25): Error: expression expected, not `End of File`
+fail_compilation/ice15855.d(25): Error: found `End of File` when expecting `)`
+fail_compilation/ice15855.d(25): Error: found `End of File` instead of statement
+fail_compilation/ice15855.d(25): Error: found `End of File` when expecting `}` following compound statement
+fail_compilation/ice15855.d(25): Error: found `End of File` when expecting `]`
+fail_compilation/ice15855.d(25): Error: no identifier for declarator `a[()
+{
+for (; 0; 0)
+{
+}
+}
+]`
+---
+*/
a[{for
+/*
+EXTRA_FILES: imports/ice7782algorithm.d imports/ice7782range.d
+TEST_OUTPUT:
+----
+fail_compilation/ice7782.d(13): Error: module `ice7782math` is in file 'imports/ice7782range/imports/ice7782math.d' which cannot be read
+import path[0] = fail_compilation
+import path[1] = $p:druntime/import$
+import path[2] = $p:phobos$
+----
+*/
+
import imports.ice7782algorithm;
import imports.ice7782range. imports.ice7782math;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice8604.d(9): Error: undefined identifier `i`
+---
+*/
struct StructFoo
{
static if(i) { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice8630.d(9): Error: undefined identifier `v`
+fail_compilation/ice8630.d(10): Error: template instance `ice8630.foo!(int[])` error instantiating
+---
+*/
auto map(alias func, R)(R r) { return r; }
typeof(v) foo(R)(R v) { return map!(p=>p)(v); }
void main() { foo([1]); }
-// PERMUTE_ARGS:
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice8742.d(15): Error: class `ice8742.main.__anonclass1` is nested within `main`, but super class `D` is nested within `C`
+---
+*/
class C
{
class D { }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice9013.d(9): Error: undefined identifier `missing`
+---
+*/
void main()
{
foreach (i; 0 .. missing)
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice9254a.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254a.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254a.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254a.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254a.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254a.d(15): Error: invalid `foreach` aggregate `false`
+---
+*/
void main()
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice9254b.d(17): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254b.d(17): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254b.d(17): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254b.d(17): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254b.d(17): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254b.d(17): Error: invalid `foreach` aggregate `false`
+---
+*/
class C
{
+/*
+TEST_OUTPUT:
+---
+fail_compilation/ice9254c.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254c.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254c.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254c.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254c.d(15): Error: Using the result of a comma expression is not allowed
+fail_compilation/ice9254c.d(15): Error: invalid `foreach` aggregate `false`
+---
+*/
void main()
{
-/* PERMUTE_ARGS:
+/*
+TEST_OUTPUT:
---
fail_compilation/imphint.d(14): Error: 'printf' is not defined, perhaps you need to import core.stdc.stdio; ?
fail_compilation/imphint.d(15): Error: 'writeln' is not defined, perhaps you need to import std.stdio; ?
/*
REQUIRED_ARGS: -m64
-PERMUTE_ARGS:
+TEST_OUTPUT:
---
fail_compilation/staticarrayoverflow.d(24): Error: static array `S[1879048192]` size overflowed to 7516192768000
fail_compilation/staticarrayoverflow.d(24): Error: variable `staticarrayoverflow.y` size overflow
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test1.d(8): Error: no identifier for declarator `fail`
+---
+*/
fail
/*
REQUIRED_ARGS: -de
+TEST_OUTPUT:
---
fail_compilation/test11176.d(12): Deprecation: b.ptr cannot be used in @safe code, use &b[0] instead
fail_compilation/test11176.d(16): Deprecation: b.ptr cannot be used in @safe code, use &b[0] instead
// REQUIRED_ARGS: -de
-module test143; // Bugzilla 143
+// https://issues.dlang.org/show_bug.cgi?id=143
+// EXTRA_FILES: imports/test143.d
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test143.d(20): Error: undefined identifier `x`
+---
+*/
+module test143;
import imports.test143;
/* https://issues.dlang.org/show_bug.cgi?id=15399
+TEST_OUTPUT:
---
fail_compilation/test15399.d(31): Error: writing to misaligned pointer in field S1.ptr is not @safe
fail_compilation/test15399.d(32): Error: writing to misaligned pointer in field S2.ptr is not @safe
-/* PERMUTE_ARGS:
+TEST_OUTPUT:
+---
+fail_compilation/test16188.d(1): Error: no identifier for declarator `TEST_OUTPUT`
+fail_compilation/test16188.d(1): Error: declaration expected, not `:`
+fail_compilation/test16188.d(18): Error: unrecognized declaration
+---
*/
// https://issues.dlang.org/show_bug.cgi?id=16188
+/*
+EXTRA_FILES: imports/test5412a.d imports/test5412b.d
+TEST_OUTPUT:
+---
+fail_compilation/test5412a.d(11): Error: import `test5412a.A` conflicts with import `test5412a.A` at fail_compilation/test5412a.d(10)
+---
+*/
module test5412a;
import A = imports.test5412a;
+/*
+EXTRA_FILES: imports/test5412a.d imports/test5412b.d
+TEST_OUTPUT:
+---
+fail_compilation/test5412b.d(11): Error: static import `test5412b.A` conflicts with import `test5412b.A` at fail_compilation/test5412b.d(10)
+---
+*/
module test5412b;
import A = imports.test5412a;
+/*
+EXTRA_FILES: test5412c2.di imports/test5412a.d
+TEST_OUTPUT:
+---
+fail_compilation/test5412c.d(11): Error: import `test5412c.test5412c2` conflicts with import `test5412c.test5412c2` at fail_compilation/test5412c.d(10)
+---
+*/
module test5412c;
import test5412c2 = imports.test5412a;
--- /dev/null
+module test5412c2;
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test8509.d(13): Error: cannot implicitly convert expression `"hello world"` of type `string` to `E`
+fail_compilation/test8509.d(14): Error: cannot implicitly convert expression `"hello world"` of type `string` to `E`
+---
+*/
module test8509;
enum E : string { a = "hello", b = "world" }
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test8751.d(7): Error: undefined identifier `Bar`
+---
+*/
Bar foo3(ref const int x) pure {
return y => x > y; // error
}
+/*
+TEST_OUTPUT:
+---
+false
+[] = int
+[] = string
+[0] = int
+[1] = string
+[] = string
+[] = int
+[1] = string
+[0] = int
+---
+
+RUN_OUTPUT:
+---
+1 1.1
+ctor
+cpctor
+dtor
+cpctor
+dtor
+dtor
+Success
+---
+*/
extern (C) int printf(const(char*) fmt, ...);
import core.vararg;
}
eval = 0;
- foreach (i, e; tup(tup((eval++, 10), 3.14), tup("str", [1,2])))
+ foreach (i, e; tup(tup((){eval++; return 10;}(), 3.14), tup("str", [1,2])))
{
static if (i == 0) assert(e == tup(10, 3.14));
static if (i == 1) assert(e == tup("str", [1,2]));
assert(eval == 1);
eval = 0;
- foreach (i, e; tup((eval++,10), tup(3.14, tup("str", tup([1,2])))))
+ foreach (i, e; tup((){eval++; return 10;}(), tup(3.14, tup("str", tup([1,2])))))
{
static if (i == 0) assert(e == 10);
static if (i == 1) assert(e == tup(3.14, tup("str", tup([1,2]))));
void test6369d()
{
int eval = 0;
- Seq!(int, string) t = tup((++eval, 10), "str");
+ Seq!(int, string) t = tup((){++eval; return 10;}(), "str");
assert(eval == 1);
assert(t[0] == 10);
assert(t[1] == "str");
alias uint DWORD;
MY_API_FUNCTION lpStartAddress;
extern (Windows) alias DWORD function(void*) MY_API_FUNCTION;
-pragma(msg, MY_API_FUNCTION.stringof);
static assert(MY_API_FUNCTION.stringof == "extern (Windows) uint function(void*)");
/************************************/
Object.init && check();
assert(x == 0);
- (check(2), false) && check();
+ check(2);
+ false && check();
assert(x == 2); x = 0;
}
Object.init || check();
assert(x == 1); x = 0;
- (check(2), true) || check();
+ check(2);
+ true || check();
assert(x == 2); x = 0;
}
void moreCommaTests()
{
- auto k = (containsAsm(), containsAsm());
+ (containsAsm(), containsAsm());
+ auto k = containsAsm();
for (int i=0; i< k^^2; i+=StructWithCtor(1).n) {}
}
+/*
+TEST_OUTPUT:
+---
+S7019(16), 16
+S7019(24), 24
+S7019(32), 32
+---
+
+RUN_OUTPUT:
+---
+Success
+---
+*/
extern(C) int printf(const char*, ...);
+/*
+TEST_OUTPUT:
+---
+int
+double
+foobar7406(T)
+test7406()
+int
+foobar7406(T)
+int
+test7406()
+---
+*/
extern(C) int printf(const char* fmt, ...);
+/*
+TEST_OUTPUT:
+---
+int delegate() pure nothrow @nogc @safe delegate() pure nothrow @nogc @safe delegate() pure nothrow @safe
+int delegate() pure nothrow @nogc @safe delegate() pure nothrow @nogc @safe delegate() pure nothrow @safe
+int
+int
+int[]
+int delegate() pure nothrow @nogc @safe function() pure nothrow @safe
+---
+
+RUN_OUTPUT:
+---
+Success
+---
+*/
import core.vararg;
extern (C) int printf(const char*, ...);
/* PERMUTE_ARGS:
+TEST_OUTPUT:
+---
+runnable/future.d(15): Deprecation: `@__future` base class method `future.A.msg` is being overridden by `future.B.msg`; rename the latter
+---
*/
class A
struct SetUnion(Rs...)
{
- pragma(msg, Rs);
Rs r;
// Rs[0] == RBRange!(RBNode!int*)
-// RUNNABLE_PHOBOS_TEST
+/* RUNNABLE_PHOBOS_TEST
+TEST_OUTPUT:
+---
+true
+g
+&Test109S(&Test109S(<recursion>))
+runnable/interpret.d(3197): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/interpret.d(3199): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/interpret.d(3202): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/interpret.d(3205): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/interpret.d(3206): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/interpret.d(3212): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/interpret.d(3213): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/interpret.d(3216): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+tfoo
+tfoo
+Crash!
+---
+*/
import std.stdio;
template Tuple(A...)
);
whiler( x < 100,
- (printf("%d\n", x), x *= 2)
+ (){ printf("%d\n", x); x *= 2; }()
);
}
// PERMUTE_ARGS: -version=A
+// EXTRA_FILES: imports/link10920a.d
// It's imported but won't be linked.
import imports.link10920a;
{
// Run semantic3 of BitArray.toString()
// before the FormatSpec instantiation in main().
- pragma(msg, typeof(ba.toString()));
+ static assert(is(typeof(ba.toString())));
}
// The instance codegen should be run always, unrelated with -version=A.
// PERMUTE_ARGS: -inline -g -debug -unittest
+// EXTRA_FILES: imports/std15021conv.d
+/*
+TEST_OUTPUT:
+---
+hit!
+---
+*/
import imports.std15021conv;
// PERMUTE_ARGS:
+// EXTRA_FILES: imports/testmangle.d
+/*
+TEST_OUTPUT:
+---
+_D7imports10testmangle12detectMangleFPSQBlQBg6DetectZQq
+_D7imports10testmangle__T10DetectTmplTiZQpFNaNbNiNfZv
+true
+false
+---
+*/
module link6574;
import imports.testmangle;
// PERMUTE_ARGS:
// EXTRA_SOURCES: imports/mangle10077.d
+// EXTRA_FILES: imports/testmangle.d
+/*
+TEST_OUTPUT:
+---
+_D7imports10testmangle12detectMangleFPSQBlQBg6DetectZQq
+_D7imports10testmangle__T10DetectTmplTiZQpFNaNbNiNfZv
+true
+false
+---
+*/
import imports.testmangle;
-// RUNNABLE_PHOBOS_TEST
+/* RUNNABLE_PHOBOS_TEST
+TEST_OUTPUT:
+---
+hello
+hello
+
+
+
+hello
+hello
+---
+
+RUN_OUTPUT:
+---
+31
+42
+53
+64
+75
+86
+97
+108
+119
+1210
+5
+test4
+Constructor
+ Inside Scope
+Destructor
+hey
+Success
+---
+*/
import std.stdio;
/*********************************************/
// REQUIRED_ARGS:
+/*
+TEST_OUTPUT:
+---
+null
+---
+*/
import core.stdc.stdio;
+/*
+TEST_OUTPUT:
+---
+pure nothrow @safe Object(bool b)
+pure nothrow @safe int*(bool b)
+pure nothrow @safe int[](bool b)
+---
+
+RUN_OUTPUT:
+---
+Success
+---
+*/
extern (C) int printf(const(char*) fmt, ...);
alias typeof(null) null_t;
// PERMUTE_ARGS: -property
+/*
+TEST_OUTPUT:
+---
+decl: test
+stmt: test
+---
+
+RUN_OUTPUT:
+---
+0: getter
+1: setter
+2: getter
+3: setter
+4: setter
+5: compile error
+6: compile error
+7: setter
+Success
+---
+*/
extern (C) int printf(const char* fmt, ...);
// PERMUTE_ARGS: -unittest -O -release -inline -fPIC -g
+/*
+TEST_OUTPUT:
+---
+runnable/sdtor.d(36): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/sdtor.d(59): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/sdtor.d(93): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/sdtor.d(117): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/sdtor.d(143): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/sdtor.d(177): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/sdtor.d(203): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+runnable/sdtor.d(276): Deprecation: The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead.
+S7353
+---
+*/
import core.vararg;
X34[2] xs;
// xs[0][0] = X34();
printf("foreach\n");
- for (int j = 0; j < xs.length; j++) { auto x = (j++,j--,xs[j]);
- //foreach(x; xs) {
+ for (int j = 0; j < xs.length; j++) {
+ j++,j--;
+ auto x = xs[j];
+ //foreach(x; xs)
//printf("foreach x.i = %d\n", x[0].i);
//assert(x[0].i == 1);
printf("foreach x.i = %d\n", x.i);
assert(S54.t == "c");
{ S54.t = null;
- int b = 1 && (bar54(S54(1)), 1);
+ int b = 1 && (){ bar54(S54(1)); return 1;}();
}
assert(S54.t == "ac");
{ S54.t = null;
- int b = 0 && (bar54(S54(1)), 1);
+ int b = 0 && (){ bar54(S54(1)); return 1;}();
}
assert(S54.t == "");
{ S54.t = null;
- int b = 0 || (bar54(S54(1)), 1);
+ int b = 0 || (){ bar54(S54(1)); return 1;}();
}
assert(S54.t == "ac");
{ S54.t = null;
- int b = 1 || (bar54(S54(1)), 1);
+ int b = 1 || (){ bar54(S54(1)); return 1;}();
}
assert(S54.t == "");
printf("----\n"); //+
dtor_cnt = 0;
- if (auto s = (S57(1), S57(2), S57(10)))
+ S57(1), S57(2);
+ if (auto s = S57(10))
{
assert(dtor_cnt == 2);
printf("ifbody\n");
printf("----\n"); //+
dtor_cnt = 0;
- if (auto s = (f(1), f(2), f(10)))
+ f(1), f(2);
+ if (auto s = f(10))
{
assert(dtor_cnt == 2);
printf("ifbody\n");
printf("----\n");
dtor_cnt = 0;
- if ((S57(1), S57(2), S57(10)))
+ S57(1), S57(2);
+ if (S57(10))
{
assert(dtor_cnt == 3);
printf("ifbody\n");
printf("----\n");
dtor_cnt = 0;
- if ((f(1), f(2), f(10)))
+ f(1), f(2);
+ if (f(10))
{
assert(dtor_cnt == 3);
printf("ifbody\n");
S64 foo64()
{
- return S64((X64(), 1));
+ X64();
+ return S64(1);
}
void test64()
if(str[ITERS-1][0].sizeof != (typ).sizeof) printf("Size Error: %d\n",str[ITERS-1][0].sizeof);
foreach(s; str) {
- int lstart;
- foreach(int idx, char c; s) {
+ size_t lstart;
+ foreach(size_t idx, char c; s) {
if(c == '\n') {
typ[] t = s[lstart..idx];
if(t != "TEST LINE") {
}
foreach(s; splitLines(cast(string)tmp)) {
- int lstart;
- foreach(int idx, char c; s) {
+ size_t lstart;
+ foreach(size_t idx, char c; s) {
if(c == '\n') {
if(s[lstart..idx] != "TEST LINE") {
printf("Error testing character array\n");
if(str.length != (ITERS * 10)) printf("Length Error: %d\n",str.length);
if(str.sizeof != (typ[]).sizeof) printf("Size Error: %d\n",str.sizeof);
- int lstart;
- foreach(int idx, char c; str) {
+ size_t lstart;
+ foreach(size_t idx, char c; str) {
if(c == '\n') {
if(str[lstart..idx] != "TEST LINE") {
printf("Error testing character array\n");
if(str.length != (ITERS * 10)) printf("Length Error: %d\n",str.length);
if(str.sizeof != (typ[]).sizeof) printf("Size Error: %d\n",str.sizeof);
- int lstart;
- foreach(int idx, char c; str) {
+ size_t lstart;
+ foreach(size_t idx, char c; str) {
if(c == '\n') {
if(str[lstart..idx] != toUTF16(cast(char[])"TEST LINE")) {
printf("Error testing character array\n");
if(str.length != (ITERS * 10)) printf("Length Error: %d\n",str.length);
if(str.sizeof != (typ[]).sizeof) printf("Size Error: %d\n",str.sizeof);
- int lstart;
- foreach(int idx, char c; str) {
+ size_t lstart;
+ foreach(size_t idx, char c; str) {
if(c == '\n') {
if(str[lstart..idx] != toUTF32(cast(char[])"TEST LINE")) {
printf("Error testing character array\n");
struct F11256(alias pred)
{
- this(int[] = null) { }
+ this(int[]) { }
}
Z!Ranges z11256(alias Z, Ranges...)(Ranges ranges)
void test11256()
{
- z11256!Z11256a(S11256.init, F11256!(gv => true)());
- z11256!Z11256b(S11256.init, F11256!(gv => true)());
- z11256!Z11256c(S11256.init, F11256!(gv => true)());
+ z11256!Z11256a(S11256.init, F11256!(gv => true)(null));
+ z11256!Z11256b(S11256.init, F11256!(gv => true)(null));
+ z11256!Z11256c(S11256.init, F11256!(gv => true)(null));
}
/********************************************/
+/*
+TEST_OUTPUT:
+---
+instantiating...
+instantiating...
+last instantiation!!!
+---
+
+RUN_OUTPUT:
+---
+1
+3
+Success
+---
+*/
import core.stdc.stdio;
-// RUNNABLE_PHOBOS_TEST
+/* RUNNABLE_PHOBOS_TEST
+TEST_OUTPUT:
+---
+This actually gets evaluated!
+()
+(bool)
+(bool, short)
+(bool, short, int)
+Alias Test instantiated
+Alias Test instantiated
+---
+*/
import std.stdio;
import core.stdc.stdio;
static assert(len == 1);
// getter
result ~= "bool " ~ name ~ "(){ return "
- "("~store~" & "~toStringSfx(maskAllElse)~") != 0;}";
+ ~ "("~store~" & "~toStringSfx(maskAllElse)~") != 0;}";
// setter
result ~= "void " ~ name ~ "(bool v){"
- "if (v) "~store~" |= "~toStringSfx(maskAllElse)~";"
- "else "~store~" &= "~toStringSfx(maskMyself)~";}";
+ ~ "if (v) "~store~" |= "~toStringSfx(maskAllElse)~";"
+ ~ "else "~store~" &= "~toStringSfx(maskMyself)~";}";
}
else
{
// getter
result ~= T.stringof ~ " " ~ name ~ "(){ auto result = "
- "("~store~" & "
+ ~ "("~store~" & "
~ toStringSfx(maskAllElse) ~ ") >>"
~ toStringSfx(offset) ~ ";";
static if (T.min < 0)
-// RUNNABLE_PHOBOS_TEST
-// PERMUTE_ARGS:
+/* RUNNABLE_PHOBOS_TEST
+PERMUTE_ARGS:
+EXTRA_FILES: imports/testmangle.d
+TEST_OUTPUT:
+---
+func
+double
+All good 1
+All good 2
+All good 3
+_D7imports10testmangle12detectMangleFPSQBlQBg6DetectZQq
+_D7imports10testmangle__T10DetectTmplTiZQpFNaNbNiNfZv
+true
+false
+uint
+int[]
+int[]
+const(K5886)
+4 ; const(K5886)
+8 ; const(K5886)
+K5886
+immutable(K5886)
+4 ; K5886
+4 ; immutable(K5886)
+1 ; K5886
+2 ; const(K5886)
+3 ; immutable(K5886)
+8 ; K5886
+9 ; const(K5886)
+10 ; immutable(K5886)
+> U = int, N:$?:64=ulong = 3LU|32=uint = 3u$
+K=string, V=int
+K=char, V=string
+T = SA, E = int, dim = $?:64=5LU|32=5u$
+T = DA, E = int
+T = AA, K = string, V = int
+pure nothrow @nogc @safe void(int t)
+pure nothrow @nogc @safe void(int t)
+T = byte
+T = char
+---
+
+RUN_OUTPUT:
+---
+typeof(T)=double typeof(S)=int
+typeof(T)=double typeof(S)=int
+typeof(T)=float typeof(S)=int
+Success
+---
+*/
module breaker;
void foo50(int[] f, ...)
{
- foreach(int i, TypeInfo ti; _arguments) { }
+ foreach(size_t i, TypeInfo ti; _arguments) { }
}
void bar50(out int[] f, ...)
{
- foreach(int i, TypeInfo ti; _arguments) { }
+ foreach(size_t i, TypeInfo ti; _arguments) { }
}
void test50()
{
A9 test1 = new A9(1, 2, 3);
A9 test2 = new A9(1, 2, 3, 4);
- int[3] arg; A9 test3 = new A9((arg[0]=1, arg[1]=2, arg[2]=3, arg));
+ int[3] arg;
+ arg[0]=1, arg[1]=2, arg[2]=3;
+ A9 test3 = new A9(arg);
}
}
// RUNNABLE_PHOBOS_TEST
+/*
+TEST_OUTPUT:
+---
+Object
+---
+*/
+
module test34;
import std.stdio;
-// RUNNABLE_PHOBOS_TEST
-// REQUIRED_ARGS:
+/* RUNNABLE_PHOBOS_TEST
+REQUIRED_ARGS:
+TEST_OUTPUT:
+---
+success
+myInt int
+myBool bool
+i
+s
+C6test42__T4T219TiZ1C
+C6test427test219FZ8__mixin11C
+---
+*/
module test42;
-
import std.stdio;
import core.stdc.stdio;
import std.string;
{
auto i = mixin("__LINE__");
writefln("%d", i);
- assert(i == 53);
+ assert(i == 63);
}
/***************************************************/
{
size_t s = Foo71!(
"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-"When dealing with complex template tuples, it's very easy to overflow the
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "helloabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+~ "When dealing with complex template tuples, it's very easy to overflow the
maximum symbol length allowed by OPTLINK. This is, simply put, a damn shame,
because it prevents otherwise completely legal code from compiling and linking
with DMDWin, whereas it works perfectly fine when using DMDNix or GDC.
int test124()
{ int result;
dchar[] aa;
- alias uint foo_t;
+ alias size_t foo_t;
foreach (foo_t i, dchar d; aa)
{
enum assocarrayliteral = Q!( [1:2] ).q.stringof;
enum complex80 = Q!( 1+1.0i ).q.stringof;
//enum dottype = Q!( C.Object.toString ).q.stringof;
- enum halt = (assert(0), 0).stringof; // ICE w/ -release
+ enum halt = 0.stringof; // ICE w/ -release
//enum remove = Q!( [1:2].remove(1) ).q.stringof;
enum templat = Q!( Q ).q.stringof;
}
printf("Count: %d\n", count);
assert(count == 1028);
}
- catch
+ catch(Throwable)
{
printf("Exception: %d\n", k);
assert(0);
}catch(Error e){
assert(e);
return 0;
- }catch{
+ }catch(Throwable){
assert(0);
}
assert(0);
* it has no side effect. Then optimizer eliminate it completely, and
* whole expression succeed to run in runtime. */
int n = 0;
- assert(thrown(aax[(n=aax[1], 0)] = 0)); // accessing aax[1] in key part, throws OK
+ assert(thrown(aax[((){ n=aax[1]; return 0;}())] = 0)); // accessing aax[1] in key part, throws OK
// This works as expected.
int[int][int] aaa;
+/*
+TEST_OUTPUT:
+---
+\ S1 S2a S2b S3a S3b S4a S4b
+- true true true true true true true
+Xa true true true true true true true
+Xb true true true true true true true
+Xc true true true true true true true
+Xd true true true true true true true
+Xe true true true true true true true
+Xf true true true true true true true
+Xg true true true true true true true
+---
+
+RUN_OUTPUT:
+---
+Success
+---
+*/
+
import core.stdc.stdio;
template TypeTuple(T...){ alias T TypeTuple; }
+/*
+TEST_OUTPUT:
+---
+const(immutable(char)*)
+inout(immutable(char)*)
+inout(const(char)*)
+inout(const(char))
+shared(inout(char))
+shared(inout(char))
+immutable(char)
+immutable(char)
+inout(const(char))
+inout(const(char))
+shared(const(char))
+shared(const(char))
+inout(char*****)
+inout(char****)*
+const(char*****)
+const(char****)*
+immutable(char*****)
+immutable(char****)*
+shared(char*****)
+shared(char****)*
+const(shared(char****)*)
+shared(const(char*****))
+shared(char*****)
+immutable(char*****)
+inout(shared(char****)*)
+inout(shared(char**)***)
+shared(inout(char**))
+immutable(string)
+const(char[])
+char[]
+shared(foo85)
+const(char[26])
+const(char[26])
+immutable(char[26])
+immutable(char[26])
+string
+int[3]
+---
+*/
import core.stdc.stdio;
// RUNNABLE_PHOBOS_TEST
// PERMUTE_ARGS:
-module dstress.run.module_01;
+module run.module_01;
import core.memory;
import core.exception;
void test7()
{
- assert(dstress.run.module_01.i==0);
- dstress.run.module_01.i++;
- assert(dstress.run.module_01.i==1);
+ assert(run.module_01.i==0);
+ run.module_01.i++;
+ assert(run.module_01.i==1);
}
/* ================================ */
{
try{
throw new Alias19();
- }catch{
+ }catch(Throwable){
return;
}
assert(0);
{
try{
foo23();
- }catch{
+ }catch(Throwable){
}
assert(status23==-1);
}
assert(status24==0);
try{
check24();
- }catch{
+ }catch(Throwable){
assert(status24==1);
status24-=5;
}
assert(!(ti is null));
writefln("%s %d %d", ti.toString(), ti.tsize, (MyUnion32*).sizeof);
assert(ti.tsize==(MyUnion32*).sizeof);
- assert(ti.toString()=="dstress.run.module_01.MyUnion32*");
+ assert(ti.toString()=="run.module_01.MyUnion32*");
}
/* ================================ */
try{
assert(!checked40);
GrandChild40 gc = new GrandChild40();
- }catch{
+ }catch(Throwable){
assert(checked40);
return;
}
-// PERMUTE_ARGS:
+/*
+PERMUTE_ARGS:
+RUN_OUTPUT:
+---
+Success
+---
+*/
extern(C) int printf(const char*, ...);
b = ES.b,
c = ES.c,
}
- static assert(EES.init == ES.init);
static assert(EES.init == S(1));
static assert(!__traits(compiles, EES.min));
static assert(!__traits(compiles, EES.max));
// @uri@ news:ct428n$2qoe$1@digitaldaemon.com
// @url@ nntp://news.digitalmars.com/D.gnu/983
-module dstress.run.unicode_06_哪里;
+module run.unicode_06_哪里;
int 哪里(int ö){
return ö+2;
}
int main(){
- assert(dstress.run.unicode_06_哪里.哪里(2)==4);
+ assert(run.unicode_06_哪里.哪里(2)==4);
return 0;
}
-// runnable/traits.d 9091,8972,8971,7027
-// runnable/test4.d test6()
+/*
+runnable/traits.d 9091,8972,8971,7027
+runnable/test4.d test6()
+RUN_OUTPUT:
+---
+Success
+---
+*/
extern(C) int printf(const char*, ...);
{
void func()
{
- pragma(msg, "====");
float[Vec11245.f.length] newVal;
}
}
// RUNNABLE_PHOBOS_TEST
// REQUIRED_ARGS: -dip25
+/*
+TEST_OUTPUT:
+---
+foo1 ulong function(return ref int* delegate() return p) ref return
+foo2 int function(return ref int delegate() p) ref
+foo3 int function(return ref inout(int*) p) ref
+foo4 int function(return ref inout(int*) p) ref
+---
+*/
import core.stdc.stdio;
// RUNNABLE_PHOBOS_TEST
-// PERMUTE_ARGS:
+/*
+PERMUTE_ARGS:
+EXTRA_FILES: imports/a9546.d
+
+Windows linker may write something like:
+---
+Creating library {{RESULTS_DIR}}/runnable/traits_0.lib and object {{RESULTS_DIR}}/runnable/traits_0.exp
+---
+
+TRANSFORM_OUTPUT: remove_lines("Creating library")
+TEST_OUTPUT:
+---
+__lambda1
+---
+*/
+
module traits;
import std.stdio;
assert(n == bar.foo.i);
}
+/********************************************************/
+
+void testIsDisabled()
+{
+ static assert(__traits(isDisabled, D1.true_));
+ static assert(!__traits(isDisabled, D1.false_));
+ static assert(!__traits(isDisabled, D1));
+}
+
/********************************************************/
// https://issues.dlang.org/show_bug.cgi?id=10100
/********************************************************/
-void testIsDisabled()
-{
- static assert(__traits(isDisabled, D1.true_));
- static assert(!__traits(isDisabled, D1.false_));
- static assert(!__traits(isDisabled, D1));
-}
-
-/********************************************************/
-
int main()
{
test1();
+/*
+EXTRA_FILES: imports/a9741.d
+TEST_OUTPUT:
+---
+tuple(3, 4, 7, (SSS))
+tuple(3, 4, 7, (SSS))
+7
+SSS
+tuple("hello")
+tuple('c')
+tuple((FFF))
+tuple(10)
+tuple(20)
+tuple(30)
+tuple((Test6))
+tuple(Test7(3, "foo"))
+tuple((Test8!"foo"))
+tuple((Test9!"foo"))
+tuple(Test10(3))
+tuple(Test11(3))
+tuple(10)
+tuple(20)
+tuple()
+tuple(40)
+B9741
+tuple((A9741))
+tuple(1)
+tuple(2)
+---
+
+RUN_OUTPUT:
+---
+Success
+---
+*/
import core.stdc.stdio;
// RUNNABLE_PHOBOS_TEST
// PERMUTE_ARGS: -unittest -O -release -inline -fPIC -g
+/* TEST_OUTPUT:
+---
+Boo!double
+Boo!int
+true
+int
+!! immutable(int)[]
+int(int i, long j = 7L)
+long
+C10390(C10390(C10390(<recursion>)))
+tuple(height)
+tuple(get, get)
+tuple(clear)
+tuple(draw, draw)
+runnable/xtest46.d(149): Deprecation: `opDot` is deprecated. Use `alias this`
+runnable/xtest46.d(151): Deprecation: `opDot` is deprecated. Use `alias this`
+runnable/xtest46.d(152): Deprecation: `opDot` is deprecated. Use `alias this`
+runnable/xtest46.d(154): Deprecation: `opDot` is deprecated. Use `alias this`
+runnable/xtest46.d(181): Deprecation: `opDot` is deprecated. Use `alias this`
+runnable/xtest46.d(183): Deprecation: `opDot` is deprecated. Use `alias this`
+runnable/xtest46.d(184): Deprecation: `opDot` is deprecated. Use `alias this`
+runnable/xtest46.d(186): Deprecation: `opDot` is deprecated. Use `alias this`
+const(int)
+string[]
+double[]
+double[]
+{}
+tuple("m")
+true
+TFunction1: extern (C) void function()
+---
+*/
import std.stdio;
import core.stdc.stdio;