220 21007 <8e48c68f-8ef1-4a2b-99e2-0defaeaa9782@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: include [[noreturn]] into function signature
Date: Tue, 29 Sep 2015 14:47:29 -0700 (PDT)
Lines: 87
Approved: news@gmane.org
Message-ID: <8e48c68f-8ef1-4a2b-99e2-0defaeaa9782@isocpp.org>
References: <c0711850-454f-432a-86b5-87552f662971@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_186_1719727515.1443563249582"
X-Trace: ger.gmane.org 1443563252 16397 80.91.229.3 (29 Sep 2015 21:47:32 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 29 Sep 2015 21:47:32 +0000 (UTC)
Cc: asorenji@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBB4UNVSYAKGQEWFJ4CFQ@isocpp.org Tue Sep 29 23:47:32 2015
Return-path: <std-proposals+bncBCEKFTV6ZUMBB4UNVSYAKGQEWFJ4CFQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f198.google.com ([209.85.220.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBB4UNVSYAKGQEWFJ4CFQ@isocpp.org>)
	id 1Zh2kG-0003oV-0P
	for gclcip-std-proposals@m.gmane.org; Tue, 29 Sep 2015 23:47:32 +0200
Original-Received: by qkdm67 with SMTP id m67sf26226111qkd.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 29 Sep 2015 14:47:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:content-type:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=PBNdeqWmuGbGN9SGSIH52Vy0xb9ARMM7bpwEKDq7zEI=;
        b=kOpET2wXg1GZjn5LJBjki9TcMBeAda6MNqIAuQoQFqy3UYMgNDz15tNG3ajRYIDBke
         9GbT5VdyesbaSSexvEj5cVXXDW7d+uAbQOzhA+hyctxXq+dLQzJbmM7U3sH4KUrycFHG
         NJ/AIxPUtOu8KpTt68CBTZE7OZvs3wuHSJTkH8Km0ZybqU+jnjqr7Orc7UtNGeF0VGQx
         WwVfGRErfGifr+RF557PDtyAJp0/yBy3WwnDrNAoeiBUOjKLjKu6jNtfPROtEesgzCVo
         O4IounnYivyUOjqnFxRbcv1ht11Tik6YRFWqVuQbCr+EYHQn+k22D1VI7R/awoFxJB+W
         2b+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:content-type:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=PBNdeqWmuGbGN9SGSIH52Vy0xb9ARMM7bpwEKDq7zEI=;
        b=c7260TCCV3yMB+vxjtD9qMN3rc+HWRCUZrvkBLbhZ9rfedjW4kykm6uFQouOn/XGfA
         ybJen+UzTLzGj8DlP4pv2hZPbo3A7kq37dRUeiy0TezYgh6u/8IXQIuU+ehbmVtIFjMH
         IU+Zj3n+R9DtxHRv++rsHEGMHj7NUNjpSIJGoMZtJ4t/hM9Zhby2mA/rArof+4i1xTQC
         PUn8z0UaEQ4Un3RWod4zXVlT1YKR2WdRUnq3cuzoUohuUUYvZc8o2udFq3UbZ60DRf+c
         HohAKrkeFr/OUJ6BR1YWs0XNNYMdBhGTZCDnAg1ARIykWGdlAp/cBWUwdWPIvcWeAPtz
         qJ7Q==
X-Gm-Message-State: ALoCoQnd5+7fcC9uM+RioFX4ttynkbllxXX/HGF5jGeIJe0YmTTVhYeTokxAM5K/hqVoH0Rc9N36
X-Received: by 10.129.83.10 with SMTP id h10mr298306ywb.6.1443563251069;
        Tue, 29 Sep 2015 14:47:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.77.75 with SMTP id q11ls1295452igw.40.canary; Tue, 29 Sep
 2015 14:47:30 -0700 (PDT)
X-Received: by 10.50.8.42 with SMTP id o10mr20701iga.7.1443563250370;
        Tue, 29 Sep 2015 14:47:30 -0700 (PDT)
In-Reply-To: <c0711850-454f-432a-86b5-87552f662971@isocpp.org>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:21007
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21007>

------=_Part_186_1719727515.1443563249582
Content-Type: multipart/alternative; 
	boundary="----=_Part_187_810777375.1443563249583"

------=_Part_187_810777375.1443563249583
Content-Type: text/plain; charset=UTF-8

On Tuesday, September 29, 2015 at 5:29:33 PM UTC-4, Aso Renji wrote:
>
> Problem:
>
> class parent
> {
>
> public:
>
>     virtual int some_method()const{error();}
>
>     [[noreturn]] virtual void error()const=0;
> };
>
>
> class child:public parent
>
> {
>
>      [[noreturn]] void error()const{throw std::runtime_error("Error in 
> class child");}
> };
>
> [[noreturn]] is not a part of error method signature. So, i have "warning: 
> no return statement in function returning non-void" in some_method. 
> Proposal - include [[noreturn]] attribute to function signature. Sory if my 
> english is bad.
>

That's up to the compiler to decide whether to give you that warning. 
You've done all you can to inform the compiler that the method doesn't need 
a return statement.

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_187_810777375.1443563249583
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tuesday, September 29, 2015 at 5:29:33 PM UTC-4, Aso Re=
nji wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><p>=
Problem:<br></p><p>class parent<br>{</p><p>public:</p><p>=C2=A0 =C2=A0 virt=
ual int some_method()const{error();}</p><p>=C2=A0 =C2=A0 [[noreturn]] virtu=
al void error()const=3D0;<br>};<br></p><p><br></p><p>class child:public par=
ent</p><p>{</p><p>=C2=A0 =C2=A0 =C2=A0[[noreturn]] void error()const{throw =
std::runtime_error(&quot;Error in class child&quot;);}<br>};<br></p><p>[[no=
return]] is not a part of error method signature. So, i have &quot;warning:=
 no return statement in function returning non-void&quot; in some_method. P=
roposal - include [[noreturn]] attribute to function signature. Sory if my =
english is bad.</p></div></blockquote><div><br>That&#39;s up to the compile=
r to decide whether to give you that warning. You&#39;ve done all you can t=
o inform the compiler that the method doesn&#39;t need a return statement.<=
br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_187_810777375.1443563249583--
------=_Part_186_1719727515.1443563249582--

.
