Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate initialization bug #570

Open
h0nzZik opened this issue Sep 12, 2019 · 0 comments
Open

Aggregate initialization bug #570

h0nzZik opened this issue Sep 12, 2019 · 0 comments

Comments

@h0nzZik
Copy link
Contributor

h0nzZik commented Sep 12, 2019

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(...) {

	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant