From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6723 invoked by alias); 17 Jul 2009 19:57:15 -0000 Received: (qmail 6657 invoked by uid 48); 17 Jul 2009 19:57:02 -0000 Date: Fri, 17 Jul 2009 19:57:00 -0000 Message-ID: <20090717195702.6656.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/40749] [4.3/4.4/4.5 Regression] g++ doesnt report missing return if return is of type const In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "simartin at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg01455.txt.bz2 ------- 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