From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13781 invoked by alias); 19 Dec 2013 01:19:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 13759 invoked by uid 89); 19 Dec 2013 01:19:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-ie0-f181.google.com Received: from mail-ie0-f181.google.com (HELO mail-ie0-f181.google.com) (209.85.223.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Dec 2013 01:19:07 +0000 Received: by mail-ie0-f181.google.com with SMTP id e14so601939iej.12 for ; Wed, 18 Dec 2013 17:19:06 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.50.136.201 with SMTP id qc9mr470739igb.11.1387415946167; Wed, 18 Dec 2013 17:19:06 -0800 (PST) Received: by 10.64.98.34 with HTTP; Wed, 18 Dec 2013 17:19:06 -0800 (PST) In-Reply-To: <1387411826.2455.325.camel@yam-132-YW-E178-FTW> References: <1387411826.2455.325.camel@yam-132-YW-E178-FTW> Date: Thu, 19 Dec 2013 01:19:00 -0000 Message-ID: Subject: Re: Add const char* constructors for exception classes in From: Jonathan Wakely To: Oleg Endo Cc: "libstdc++@gcc.gnu.org" , gcc-patches Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-12/txt/msg01640.txt.bz2 On 19 December 2013 00:10, Oleg Endo wrote: > Hello, > > When writing code such as > ... > throw std::logic_error ("cold coffee"); > ... > currently the construction of std::string happens in the code that > throws the exception, which results in code bloat. Implementing the > const char* constructors as defined by C++11 fixes the issue. > I'm not sure whether the #if __cplusplus >= 201103L checks are required. > C++98 code could also benefit from the overloads. I think there was some good reason we haven't added these yet, but I can't remember it. > Tested with 'make all' and 'make install', writing a hello world and > checking the asm output. For all patches we need to know that the libstdc++ testsuite passes too.