diff --git a/tccgen.c b/tccgen.c
index 5b0c2a63..0d686961 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -5033,13 +5033,16 @@ ST_FUNC void unary(void)
 	int has_match = 0;
 	int learn = 0;
 	TokenString *str = NULL;
+	int saved_const_wanted = const_wanted;
 
 	next();
 	skip('(');
+	const_wanted = 0;
 	expr_type(&controlling_type, expr_eq);
 	controlling_type.t &= ~(VT_CONSTANT | VT_VOLATILE | VT_ARRAY);
 	if ((controlling_type.t & VT_BTYPE) == VT_FUNC)
 	  mk_pointer(&controlling_type);
+	const_wanted = saved_const_wanted;
 	for (;;) {
 	    learn = 0;
 	    skip(',');
diff --git a/tests/tests2/94_generic.c b/tests/tests2/94_generic.c
index 6e20282c..e5df2a77 100644
--- a/tests/tests2/94_generic.c
+++ b/tests/tests2/94_generic.c
@@ -71,5 +71,8 @@ int main()
 
 	(void)_Generic((int(*)[2]){0}, int(*)[2]:0, int(*)[4]:0); //shouldn't match twice
 
+	//should accept ({ }) in the controlling expr of _Generic even in const_wanted contexts
+	struct { _Bool x_0: _Generic(({0;}),default:1); } my_x;
+
 	return 0;
 }