Skip to content

Aggregate initialization bug #570

@h0nzZik

Description

@h0nzZik

The following code does not compile:

extern "C" int puts(char const *);
struct A {
	/*explicit*/ A(int){}
	~A(){puts("~A()");}
};

int t() {
	throw 5;
}

struct B {
	//A a{{1}};
	A a{1};
	int x = t();
};

int main() {
	try {
		//B b{{1}};	// fails in listInit
		B b{1}; // fails in figureInit
		//B b;
	} catch(...) {

	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions