public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57632] New: Operator new overloads with stdc++11 enabled looses exception specifier (MacOsX)
@ 2013-06-17  5:51 basv@odd-e.com
  2013-06-17  9:45 ` [Bug c++/57632] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: basv@odd-e.com @ 2013-06-17  5:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57632
           Summary: Operator new overloads with stdc++11 enabled looses
                    exception specifier (MacOsX)
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: basv@odd-e.com

G++ on MacOsX acts different when enabling the new c++11 related to operator
new overloads. If I compile the following code:

#include "stdlib.h"
#include <new>

void* operator new(size_t mem) throw(std::bad_alloc);
void* operator new(size_t mem) throw(std::bad_alloc);

Then when compiling g++ new.cpp, it compiles fine.
But when I compile g++ -std=c++11 new.cpp, then it results in this error:

new.cpp:6:52: error: declaration of ‘void* operator new(size_t) throw
(std::bad_alloc)’ has a different exception specifier
 void* operator new(size_t mem) throw(std::bad_alloc);
                                                    ^
new.cpp:5:7: error: from previous declaration ‘void* operator new(std::size_t)’
 void* operator new(size_t mem) throw(std::bad_alloc);
       ^
------------

I've not been able to replicate this under linux and digging into it a bit, it
seems to relate to the c++config.h definitions of _GLIBCXX_THROW.
>From gcc-bugs-return-424515-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 17 06:48:50 2013
Return-Path: <gcc-bugs-return-424515-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30775 invoked by alias); 17 Jun 2013 06:48:50 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 30107 invoked by uid 48); 17 Jun 2013 06:48:43 -0000
From: "jbeulich at novell dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/53425] No warnings are given for -mno-sse
Date: Mon, 17 Jun 2013 06:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jbeulich at novell dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-53425-4-R0sLLe9d2d@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-53425-4@http.gcc.gnu.org/bugzilla/>
References: <bug-53425-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-06/txt/msg00894.txt.bz2
Content-length: 686

http://gcc.gnu.org/bugzilla/show_bug.cgi?idS425

jbeulich at novell dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jbeulich at novell dot com

--- Comment #4 from jbeulich at novell dot com ---
I don't think this is quite right for 32-bit: For one, MMX types should be
handled separately in that case. And there are now two warnings for both MMX
and SSE types, i.e. the new one is redundant with the ones generated by
function_arg_32(). I believe all that's needed is adding TARGET_64BIT to the
conditional in type_natural_mode().


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-08  3:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-17  5:51 [Bug c++/57632] New: Operator new overloads with stdc++11 enabled looses exception specifier (MacOsX) basv@odd-e.com
2013-06-17  9:45 ` [Bug c++/57632] " paolo.carlini at oracle dot com
2022-01-07  5:49 ` pinskia at gcc dot gnu.org
2022-01-07 12:47 ` redi at gcc dot gnu.org
2022-01-07 23:47 ` pinskia at gcc dot gnu.org
2022-01-08  3:38 ` [Bug c++/57632] diagonistic for different exception specifier/noexcept if decl is declared twice should be improved pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).