tree designator;
tree initializer;
bool clause_non_constant_p;
+ bool direct_p = false;
location_t loc = cp_lexer_peek_token (parser->lexer)->location;
/* Handle the C++20 syntax, '. id ='. */
if (cp_lexer_next_token_is (parser->lexer, CPP_EQ))
/* Consume the `='. */
cp_lexer_consume_token (parser->lexer);
+ else
+ direct_p = true;
}
/* Also, if the next token is an identifier and the following one is a
colon, we are looking at the GNU designated-initializer
if (clause_non_constant_p && non_constant_p)
*non_constant_p = true;
+ if (TREE_CODE (initializer) == CONSTRUCTOR)
+ /* This uses |= rather than = because C_I_D_I could have been set in
+ cp_parser_functional_cast so we must be careful not to clear the
+ flag. */
+ CONSTRUCTOR_IS_DIRECT_INIT (initializer) |= direct_p;
+
/* If we have an ellipsis, this is an initializer pack
expansion. */
if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))