On 10/30/2011 01:13 PM, Ed Smith-Rowland wrote:
+  /* Look for a literal operator taking the exact type of numeric argument
+     as the literal value.  */

Is this right? Do numeric literals only get here with type unsigned long long or long double?

+  while (fns)
     {
       tree tmpl_args = make_char_string_pack (num_string);
-      decl = lookup_template_function (decl, tmpl_args);
-      result = finish_call_expr (decl, &args, false, true, tf_none);
-      if (result != error_mark_node)
+      tree fn = OVL_CURRENT (fns);
+      tree argtypes = NULL_TREE;
+      if (TREE_CODE (TREE_TYPE (fn)) != LANG_TYPE)
+       argtypes = TYPE_ARG_TYPES (TREE_TYPE (fn));
+      if (argtypes != NULL_TREE
+         && same_type_p (TREE_VALUE (argtypes), void_type_node))

Let's wait to make the pack until we find a template. Also, you should be able to just check for TEMPLATE_DECL since we won't accept a literal operator template with different parameter types.

For string and character literals, we can still just build up a call; we only need to walk the overload list here for numeric literals.

Jason

Reply via email to