2019-03-21 Jakub Jelinek <jakub@redhat.com>
+ PR c++/71446
+ * call.c (filed_in_pset): Change pset from hash_set<tree> * to
+ hash_set<tree, true> &, adjust uses accordingly.
+ (build_aggr_conv): Change pset from hash_set<tree> *
+ to hash_set<tree, true>. Replace goto fail; with return NULL;,
+ adjust pset uses.
+
PR c++/89767
* parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
variables, check for duplicates in this function.
is in PSET. */
static bool
-field_in_pset (hash_set<tree> *pset, tree field)
+field_in_pset (hash_set<tree, true> &pset, tree field)
{
- if (pset->contains (field))
+ if (pset.contains (field))
return true;
if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
for (field = TYPE_FIELDS (TREE_TYPE (field));
conversion *c;
tree field = next_initializable_field (TYPE_FIELDS (type));
tree empty_ctor = NULL_TREE;
- hash_set<tree> *pset = NULL;
+ hash_set<tree, true> pset;
/* We already called reshape_init in implicit_conversion. */
complain);
if (!ok)
- goto fail;
+ return NULL;
/* For unions, there should be just one initializer. */
if (TREE_CODE (type) == UNION_TYPE)
{
i = 1;
break;
}
- if (pset == NULL)
- pset = new hash_set<tree>;
- pset->add (idx);
+ pset.add (idx);
}
else
- goto fail;
+ return NULL;
}
}
tree val;
bool ok;
- if (pset && field_in_pset (pset, field))
+ if (pset.elements () && field_in_pset (pset, field))
continue;
if (i < CONSTRUCTOR_NELTS (ctor))
{
val = get_nsdmi (field, /*ctor*/false, complain);
else if (TYPE_REF_P (ftype))
/* Value-initialization of reference is ill-formed. */
- goto fail;
+ return NULL;
else
{
if (empty_ctor == NULL_TREE)
complain);
if (!ok)
- goto fail;
+ return NULL;
if (TREE_CODE (type) == UNION_TYPE)
break;
}
if (i < CONSTRUCTOR_NELTS (ctor))
- {
- fail:
- if (pset)
- delete pset;
- return NULL;
- }
+ return NULL;
- if (pset)
- delete pset;
c = alloc_conversion (ck_aggr);
c->type = type;
c->rank = cr_exact;