This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/32208] Patch for 32158 has bad code in std::vector::_M_fill_initialize
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jun 2007 22:57:01 -0000
- Subject: [Bug libstdc++/32208] Patch for 32158 has bad code in std::vector::_M_fill_initialize
- References: <bug-32208-11211@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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