mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 21:51:03 +03:00
Move dmd files into compiler/
This commit is contained in:
parent
20bd0cacbd
commit
6374bb87b7
4579 changed files with 4 additions and 4 deletions
51
compiler/test/compilable/debugInference.d
Normal file
51
compiler/test/compilable/debugInference.d
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
REQUIRED_ARGS: -debug
|
||||
https://issues.dlang.org/show_bug.cgi?id=20507
|
||||
*/
|
||||
|
||||
|
||||
void main() pure nothrow @safe @nogc
|
||||
{
|
||||
debug foo();
|
||||
bar!()();
|
||||
}
|
||||
|
||||
void foo() @system
|
||||
{
|
||||
// Just to be sure its neither @nogc, pure or nothrow
|
||||
__gshared int counter = 0;
|
||||
|
||||
if (counter++)
|
||||
throw new Exception(new immutable(char)[counter]);
|
||||
}
|
||||
|
||||
void bar()()
|
||||
{
|
||||
debug {
|
||||
foo();
|
||||
|
||||
auto fPtr = &S.f;
|
||||
auto f2Ptr = &f2;
|
||||
|
||||
S s;
|
||||
destroy(s);
|
||||
|
||||
int* ptr = cast(int*) 0;
|
||||
int[] slice = ptr[0 .. 4];
|
||||
int val = ptr[1];
|
||||
|
||||
void[] bytes = slice;
|
||||
bytes[] = bytes[];
|
||||
|
||||
scope int n;
|
||||
int* pn = &n;
|
||||
}
|
||||
}
|
||||
|
||||
class S {
|
||||
void f() @safe {}
|
||||
}
|
||||
|
||||
ref int f2(return ref int i) {
|
||||
return i;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue