Skip to content

Aggregate initialization bug #570

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

	}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions