This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/32208] Patch for 32158 has bad code in std::vector::_M_fill_initialize



------- Comment #2 from reichelt at gcc dot gnu dot org  2007-06-06 22:57 -------
Just a note:

> Also, shouldn't there also be an error about lack of return type for
> _M_fill_initialize?

Well, here's the code snippet from the function grokdeclarator in decl.c
that deals with missing return types:

      if (type_was_error_mark_node)
        /* We've already issued an error, don't complain more.  */;
      else if (in_system_header || flag_ms_extensions)
        /* Allow it, sigh.  */;
      else if (pedantic || ! is_main)
        pedwarn ("ISO C++ forbids declaration of %qs with no type", name);
      else
        warning (OPT_Wreturn_type,
                 "ISO C++ forbids declaration of %qs with no type", name);

As you can see, return types may be omitted in system headers
(probably because there were too many systems with such headers around).
Otherwise you should get a diagnostic.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]