220 31540 <cc73faa8-2e33-4314-b50b-cf715b4e7ccf@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Morwenn <morwenn29@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: First draft of [[unreachable]] attribute proposal
Date: Fri, 10 Mar 2017 04:41:05 -0800 (PST)
Lines: 167
Approved: news@gmane.org
Message-ID: <cc73faa8-2e33-4314-b50b-cf715b4e7ccf@isocpp.org>
References: <e6a951ab-a7eb-4bce-86fd-6988215e2309@isocpp.org>
 <74928e4c-8f1e-4036-93d8-2560c27b651d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2161_913442477.1489149665587"
X-Trace: blaine.gmane.org 1489149685 32305 195.159.176.226 (10 Mar 2017 12:41:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 10 Mar 2017 12:41:25 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC2ZP4V74IFBBYV5RLDAKGQEMYVZWBA@isocpp.org Fri Mar 10 13:41:15 2017
Return-path: <std-proposals+bncBC2ZP4V74IFBBYV5RLDAKGQEMYVZWBA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC2ZP4V74IFBBYV5RLDAKGQEMYVZWBA@isocpp.org>)
	id 1cmJr2-00062H-Dk
	for gclcip-std-proposals@m.gmane.org; Fri, 10 Mar 2017 13:41:08 +0100
Original-Received: by mail-yw0-f199.google.com with SMTP id v76sf93907802ywg.4
        for <gclcip-std-proposals@m.gmane.org>; Fri, 10 Mar 2017 04:41:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :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=rF95QR4ggtCRD4mJLp0x6jajBX1wXWPb3xIMB4lLGdc=;
        b=zLZzvL+rhdI3eRLACbMgW11VvO+Si4Es3wtZH6LWeIZIkXcEKss0oMYwy2W5jiCEkf
         0udFlUxz45B9/A8JJv7P4F7RIVBc5mxc1MVvaMJh5FdsDurCUvGogtf2q8kpb9gLBhco
         xND5YGw3K8MxttJXwwWcfWnOauS02fNzk0YXwHiaEqngCb8yD/Q4CG3vczaLC4JKNGyF
         vmqNyqyudgbY9ijDhbstlqFKvSU4Au8kMkYvzmEuAo2mzx+0r+YwHSRZWJ6YiBof52Sr
         QCANA0UOc5d5vkyAYE9FSVJuLK5f7vitAGRZqcewJ/V2vV3cIRsc+1WHBASXaD6STpi1
         uwgg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :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=rF95QR4ggtCRD4mJLp0x6jajBX1wXWPb3xIMB4lLGdc=;
        b=kSCzPPqTdMW/9gCVuljM0RV3BjGvg4wyGqajt//hAPk+1ZcMlQooh//HU9zcEF1cQh
         vh8amE2s5492Y0mIO5TGENjYHp5jtxaT3M0zsi1gdLgZ0MXV1XzvUk1enD68HlOgFZlT
         GAhXgKH+EXrgDViRRX1YlH+My9ggAKmuh0+HcTk/dEG7GHjTxMq/wgQWqqOVkWH0RhWH
         PSsZKJ3G7gFVmXDt2oAe9WVcLYPeXKSl3QiMgLT8j3sIkhCktQuZbj0iZ3ivjV2HXgSn
         eoM1auGX+oHvvHRVmSU5FYZhBW6In4sVrqtUOKjZyfXd+Iw+M7B8UfEiAuysCyNDVtBy
         4I0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version: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=rF95QR4ggtCRD4mJLp0x6jajBX1wXWPb3xIMB4lLGdc=;
        b=WqAu7meznP6ozwr3EtoyMopwChzmDAoBCyl83jVuos1oWrqNKXU+ognQpQIUvPxbva
         ISKuZhav7Pox5QppWwCFrOhq2ucwNHcp1FhNSVzEdfuqWbojz/+13CcWrc2IEpE8M/FU
         0i9T0Ws8Mf7FPWX5ydNuF+/70kuDmFeqv6k+yKOZmeVo4jeUEiIxhCOA0im9WeMYVsce
         Hfdhcn4CEkA7cJhPoX1tQrSbIWEgmWi3ctw2yO+6ZAGH9VvuboyJsDjH6eVk/FjaXitJ
         go6mZrdrxblgfcdMHu9snl9JMuu018D9an6aobGWlDv/08/aGpHcKAzVwuOA+QwcWe1y
         O1Bw==
X-Gm-Message-State: AMke39m2kGQE/5GkCFu2xqQXn7+0rSaPqLDthilYmvOtEgZdO2v3js7cxQS1EylpN/aWfA==
X-Received: by 10.129.173.101 with SMTP id l37mr7262359ywk.73.1489149667120;
        Fri, 10 Mar 2017 04:41:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.4.119 with SMTP id 110ls8105821otc.44.gmail; Fri, 10 Mar
 2017 04:41:06 -0800 (PST)
X-Received: by 10.157.13.82 with SMTP id 76mr2060988oti.6.1489149666193;
        Fri, 10 Mar 2017 04:41:06 -0800 (PST)
In-Reply-To: <74928e4c-8f1e-4036-93d8-2560c27b651d@isocpp.org>
X-Original-Sender: morwenn29@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:31540
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31540>

------=_Part_2161_913442477.1489149665587
Content-Type: multipart/alternative; 
	boundary="----=_Part_2162_1258772651.1489149665587"

------=_Part_2162_1258772651.1489149665587
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Le vendredi 10 mars 2017 13:04:37 UTC+1, Andrzej Krzemie=C5=84ski a =C3=A9c=
rit :
>
>
>
> W dniu czwartek, 9 marca 2017 04:49:35 UTC+1 u=C5=BCytkownik Myriachan na=
pisa=C5=82:
>>
>> I wrote up a proposal document for a new attribute, [[unreachable]],=20
>> which lets you mark locations in code as being unreachable for optimizat=
ion=20
>> purposes, or to suppress certain warnings.
>>
>> This has been discussed on the mailing list before; there's a link to=20
>> that thread in the .pdf.
>>
>> https://1drv.ms/b/s!Agwy_QljRwlGgcoJeZMiimuq3H36Ww=20
>> <https://www.google.com/url?q=3Dhttps%3A%2F%2F1drv.ms%2Fb%2Fs!Agwy_QljRw=
lGgcoJeZMiimuq3H36Ww&sa=3DD&sntz=3D1&usg=3DAFQjCNH4Mt71oANAe87AA1PY9Qf74w5y=
WQ>
>>
>> I have no idea what to do with it now.  If you have any comments on the=
=20
>> content, or how to actually proceed, let me know! =3D^-^=3D
>>
>> Melissa
>>
>
> Melissa, the functionality you propose is definitely useful. However, it=
=20
> looks to me that it is already contained in the contracts proposal:=20
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0542r0.html
>
> Under the contract proposal, anywhere where the statement is expected, yo=
u=20
> can type:
>
> [[assert: false]];
>
> Which is somewhat similar to old macro assert(), but is not a macro=20
> anymore and is allowed to be a hint for optimizations and warning=20
> generation, and additionally is allowed to be static-analysis-tested for=
=20
> correctness.
>
> If contracts get accepted [[unreachable]] will become redundant. However=
=20
> contracts are a big and novel feature, which makes it likely for them to=
=20
> miss the place in C++20. Your proposal is small, so it has bigger chances=
=20
> of succeeding.
>
> Anyway, it would be fair to put a comparison with contracts in your=20
> proposal.
>
> Good luck.
> &rzej; =20
>

While [[assert axiom: false]] is probably semantically equivalent to the=20
proposed [[unreachable]], the former doesn't really convey the meaning.

I would be more confortable adding [[unreachable]] to the default branch of=
=20
a switch than the equivalent [[assert axiom: false]].

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/cc73faa8-2e33-4314-b50b-cf715b4e7ccf%40isocpp.or=
g.

------=_Part_2162_1258772651.1489149665587
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Le vendredi 10 mars 2017 13:04:37 UTC+1, Andrzej Krzemie=
=C5=84ski a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><=
div dir=3D"ltr"><br><br>W dniu czwartek, 9 marca 2017 04:49:35 UTC+1 u=C5=
=BCytkownik Myriachan napisa=C5=82:<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">I wrote up a proposal document for a new attribute, [[unr=
eachable]], which lets you mark locations in code as being unreachable for =
optimization purposes, or to suppress certain warnings.<br><br>This has bee=
n discussed on the mailing list before; there&#39;s a link to that thread i=
n the .pdf.<br><br><a href=3D"https://www.google.com/url?q=3Dhttps%3A%2F%2F=
1drv.ms%2Fb%2Fs!Agwy_QljRwlGgcoJeZMiimuq3H36Ww&amp;sa=3DD&amp;sntz=3D1&amp;=
usg=3DAFQjCNH4Mt71oANAe87AA1PY9Qf74w5yWQ" rel=3D"nofollow" target=3D"_blank=
" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%=
2F%2F1drv.ms%2Fb%2Fs!Agwy_QljRwlGgcoJeZMiimuq3H36Ww\x26sa\x3dD\x26sntz\x3d1=
\x26usg\x3dAFQjCNH4Mt71oANAe87AA1PY9Qf74w5yWQ&#39;;return true;" onclick=3D=
"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2F1drv.ms%2Fb=
%2Fs!Agwy_QljRwlGgcoJeZMiimuq3H36Ww\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjC=
NH4Mt71oANAe87AA1PY9Qf74w5yWQ&#39;;return true;">https://1drv.ms/b/s!Agwy_<=
wbr>QljRwlGgcoJeZMiimuq3H36Ww</a><br><br>I have no idea what to do with it =
now.=C2=A0 If you have any comments on the content, or how to actually proc=
eed, let me know! =3D^-^=3D<br><br>Melissa<br></div></blockquote><div><br>M=
elissa, the functionality you propose is definitely useful. However, it loo=
ks to me that it is already contained in the contracts proposal: <a href=3D=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0542r0.html" targ=
et=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.g=
oogle.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdoc=
s%2Fpapers%2F2017%2Fp0542r0.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEJ=
Nud7AqJtcFj3C6c2OKL6v1ZlmA&#39;;return true;" onclick=3D"this.href=3D&#39;h=
ttp://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2=
Fwg21%2Fdocs%2Fpapers%2F2017%2Fp0542r0.html\x26sa\x3dD\x26sntz\x3d1\x26usg\=
x3dAFQjCNEJNud7AqJtcFj3C6c2OKL6v1ZlmA&#39;;return true;">http://www.open-st=
d.org/jtc1/<wbr>sc22/wg21/docs/papers/2017/<wbr>p0542r0.html</a><br><br>Und=
er the contract proposal, anywhere where the statement is expected, you can=
 type:<br><br><div style=3D"background-color:rgb(250,250,250);border-color:=
rgb(187,187,187);border-style:solid;border-width:1px"><code><div><span styl=
e=3D"color:#660">[[</span><span style=3D"color:#008">assert</span><span sty=
le=3D"color:#660">:</span><span style=3D"color:#000"> </span><span style=3D=
"color:#008">false</span><span style=3D"color:#660">]];</span></div></code>=
</div><br>Which is somewhat similar to old macro assert(), but is not a mac=
ro anymore and is allowed to be a hint for optimizations and warning genera=
tion, and additionally is allowed to be static-analysis-tested for correctn=
ess.<br><br>If contracts get accepted [[unreachable]] will become redundant=
.. However contracts are a big and novel feature, which makes it likely for =
them to miss the place in C++20. Your proposal is small, so it has bigger c=
hances of succeeding.<br><br>Anyway, it would be fair to put a comparison w=
ith contracts in your proposal.<br><br>Good luck.<br>&amp;rzej;=C2=A0 <br><=
/div></div></blockquote><div><br>While <span style=3D"font-family: courier =
new,monospace;">[[assert axiom: false]]</span> is probably semantically equ=
ivalent to the proposed <span style=3D"font-family: courier new,monospace;"=
>[[unreachable]]</span>, the former doesn&#39;t really convey the meaning.<=
br><br>I would be more confortable adding <span style=3D"font-family: couri=
er new,monospace;">[[unreachable]]</span> to the <span style=3D"font-family=
: courier new,monospace;">default</span> branch of a <span style=3D"font-fa=
mily: courier new,monospace;">switch</span> than the equivalent <span style=
=3D"font-family: courier new,monospace;">[[assert axiom: false]]<font face=
=3D"arial,sans-serif">.</font></span><br></div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/cc73faa8-2e33-4314-b50b-cf715b4e7ccf%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/cc73faa8-2e33-4314-b50b-cf715b4e7ccf=
%40isocpp.org</a>.<br />

------=_Part_2162_1258772651.1489149665587--

------=_Part_2161_913442477.1489149665587--

.
