ubuntu-buildroot/output/build/host-gcc-initial-11.4.0/gcc/testsuite/gdc.test/runnable/test16115.d

39 lines
480 B
D

/*
REQUIRED_ARGS: -d
PERMUTE_ARGS:
*/
// https://issues.dlang.org/show_bug.cgi?id=16115
// https://github.com/dlang/dmd/pull/3979
int n;
struct Test
{
enum tag = 42;
}
enum tagx = 42;
auto call()
{
version (none) // works
{
n = Test.tag;
return null;
}
else // assert error
{
//return n = tagx, null;
return n = Test.tag, null;
//return n = Test.tag;
}
}
void main()
{
call();
assert(n == 42);
}