view gcc/testsuite/gdc.test/fail_compilation/ice10259.d @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

/*
TEST_OUTPUT:
---
fail_compilation/ice10259.d(11): Error: circular reference to 'ice10259.D.d'
fail_compilation/ice10259.d(11):        called from here: (*function () => x)()
---
*/
class D
{
    int x;
    D d = { auto x = new D(); return x; }();
}
enum x = new D;

/*
TEST_OUTPUT:
---
fail_compilation/ice10259.d(25): Error: circular reference to 'ice10259.D2.d'
fail_compilation/ice10259.d(25):        called from here: (*function () => x)()
---
*/
class D2
{
    int x;
    D2 d = function { auto x = new D2(); return x; }();
}
enum x2 = new D2;