[C++] warn_synth considered obsolete

gcc@integrable-solutions.net gcc@integrable-solutions.net
Sun Jan 2 13:40:00 GMT 2005


Hi,

While looking into PR C++/18644, it occurs to me that the option
-Wsynth is no longer useful. 

   First, the diagnostic does not make any sense to me.  Does anybody
understand it, what it is trying to say and how it could have been
useful? 

   Second, the compiler has long deviated from (pre) C++-ARM
semantics and there is no way to revert to C++-ARM (assuming that
makes sense).

   Third, there remains only *one* use of warn_synth in the whole C++
front-end; looking at the ChangeLogs it seems to me that its
application area has shrinked over the time.

  My suggestion to fix C++/18644 is to remove the code

          if (warn_synth
              && fnname == ansi_assopname (NOP_EXPR)
              && DECL_ARTIFICIAL (cand->fn)
              && candidates->next
              && ! candidates->next->next)
            {
              warning ("using synthesized %q#D for copy assignment",
                          cand->fn);
              cp_warning_at ("  where cfront would use %q#D",
                             cand == candidates
                             ? candidates->next->fn
                             : candidates->fn);
            }

from cp/call.c:build_new_op().  That removal would make the switch
actually unused; consequently I propose to deprecate it.

Thoughts?

-- Gaby



More information about the Gcc mailing list