This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40749] [4.3/4.4/4.5 Regression] g++ doesnt report missing return if return is of type const <type>
- From: "simartin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2009 19:57:02 -0000
- Subject: [Bug c++/40749] [4.3/4.4/4.5 Regression] g++ doesnt report missing return if return is of type const <type>
- References: <bug-40749-17948@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from simartin at gcc dot gnu dot org 2009-07-17 19:57 -------
It seems to be caused by the fix for PR#18313. I am testing the following:
Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c (revision 149752)
+++ gcc/cp/decl.c (working copy)
@@ -8314,12 +8314,14 @@
if (type_quals != TYPE_UNQUALIFIED)
{
if (SCALAR_TYPE_P (type) || VOID_TYPE_P (type))
- warning (OPT_Wignored_qualifiers,
- "type qualifiers ignored on function return type");
+ {
+ warning (OPT_Wignored_qualifiers,
+ "type qualifiers ignored on function return
type");
+ set_no_warning = true;
+ }
/* We now know that the TYPE_QUALS don't apply to the
decl, but to its return type. */
type_quals = TYPE_UNQUALIFIED;
- set_no_warning = true;
}
errmsg = targetm.invalid_return_type (type);
if (errmsg)
--
simartin at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |simartin at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40749