"%<-std=c++2c%> or %<-std=gnu++2c%>");
binding->value = name_lookup::ambiguous (decl, binding->value);
}
+ else if (binding->scope->kind != sk_class
+ && TREE_CODE (decl) == USING_DECL
+ && decls_match (target_bval, target_decl))
+ /* Since P1787 (DR 36) it is OK to redeclare entities via using-decl,
+ except in class scopes. */
+ ok = false;
else
{
if (!error_operand_p (bval))
else if (value
/* Ignore anticipated builtins. */
&& !anticipated_builtin_p (value)
- && (fn_scope_p
- || !decls_match (lookup.value, strip_using_decl (value))))
+ && !decls_match (lookup.value, strip_using_decl (value)))
{
diagnose_name_conflict (lookup.value, value);
failed = true;
type = binding->type;
}
- /* DR 36 questions why using-decls at function scope may not be
- duplicates. Disallow it, as C++11 claimed and PR 20420
- implemented. */
if (lookup)
do_nonmember_using_decl (*lookup, true, true, &value, &type);