http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54161

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-02 
18:41:54 UTC ---
The code checking for this is in c-common.c, thus changing the behavior is a
*tad* less trivial than it could be, we have to check c_dialect_cxx (), but
definitely very easy to do, if we wanted. Jason can you double check whether we
want to reject even without -pedantic?

Anyway, Daniel, it would be nice if you could add also SFINAE testcase too,
because likely it's a different issue: AFAICS, when we are in a SFINAE context,
the complain passed to c_sizeof_or_alignof_type should be false, thus the
function should return error_mark_node anyway, which, if properly checked by
the caller, should be enough for a correct SFINAE, irrespective of -pedantic or
any other command line option. Eg, for function type:

      if (is_sizeof)
    {
      if (complain && (pedantic || warn_pointer_arith))
        pedwarn (loc, pedantic ? OPT_Wpedantic : OPT_Wpointer_arith,
             "invalid application of %<sizeof%> to a function type");
          else if (!complain)
            return error_mark_node;
      value = size_one_node;
    }

Reply via email to