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 c++/40749] [4.3/4.4/4.5 Regression] g++ doesnt report missing return if return is of type const <type>



------- 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


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