Hi,

On 06/06/2012 03:57 AM, Jason Merrill wrote:
On 06/05/2012 08:23 PM, Paolo Carlini wrote:
@@ -1695,6 +1695,8 @@ implicit_conversion (tree to, tree from, tree expr
          |LOOKUP_NO_TEMP_BIND|LOOKUP_NO_RVAL_BIND|LOOKUP_PREFER_RVALUE
          |LOOKUP_NO_NARROWING|LOOKUP_PROTECT);

+  complain&= ~tf_error;

I don't think we want warnings from implicit_conversion, either.
I thought we already somewhat discussed this issue (when I said that passing tf_warning instead of tf_none could work better, remember?), but now I see that I kept a lot of it for myself . If I do something like

    complain&= ~(tf_warning|tf_error);

then we regress on, eg, g++.old-deja/g++.benjamin/16077.C, that is, we don't produce any warnings anymore.

-          if (flags & LOOKUP_COMPLAIN)
-        permerror (loc, "conversion from %q#T to %q#T", intype, type);
-          if (!flag_permissive)
+          if (complain & tf_error)
+        {
+          permerror (loc, "conversion from %q#T to %q#T",
+                 intype, type);
+          if (!flag_permissive)
+            return error_mark_node;

I don't think we need the last two lines anymore, we can use the usual pattern of return error if sfinae, permerror and continue otherwise.
Sure.

Thanks,
Paolo.

Reply via email to