On 10/12/18 12:32 PM, Marek Polacek wrote:
+ EXPLICIT_SPECIFIER is used in case the explicit-specifier, if any, has
+ value-dependent expression. */
static void
cp_parser_decl_specifier_seq (cp_parser* parser,
cp_parser_flags flags,
cp_decl_specifier_seq *decl_specs,
- int* declares_class_or_enum)
+ int* declares_class_or_enum,
+ tree* explicit_specifier)
Why not add the explicit-specifier to cp_decl_specifier_seq? They don't
live very long, so making them bigger isn't a concern. Then other of
the handling could move into grokdeclarator along with the other
explicit handling.
@@ -12822,6 +12844,17 @@ tsubst_function_decl (tree t, tree args,
tsubst_flags_t complain,
if (!uses_template_parms (DECL_TI_ARGS (t)))
return t;
+ /* Handle explicit(dependent-expr). */
+ if (DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P (t))
+ {
+ tree spec = lookup_explicit_specifier (t);
+ spec = tsubst_copy_and_build (spec, args, complain, in_decl,
+ /*function_p=*/false,
+ /*i_c_e_p=*/true);
+ spec = build_explicit_specifier (spec, complain);
+ DECL_NONCONVERTING_P (t) = (spec == boolean_true_node);
+ }
This is setting DECL_NONCONVERTING_P on the template, rather than the
instantiation r, which hasn't been created yet at this point; this
handling needs to move further down in the function.
Jason