220 13345 <a998f97e-fc88-4fff-a192-3eeb52e56df1@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Matheus Izvekov <mizvekov@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: proposal: deprecate failure to return
 (without annotation)
Date: Mon, 29 Sep 2014 16:41:21 -0700 (PDT)
Lines: 138
Approved: news@gmane.org
Message-ID: <a998f97e-fc88-4fff-a192-3eeb52e56df1@isocpp.org>
References: <m0cb44$d2e$1@ger.gmane.org> <2106187.KAVOBzdsgo@tjmaciei-mobl4> <m0ceva$afs$1@ger.gmane.org>
 <7890243.H6e3ul2NkU@tjmaciei-mobl4>
 <b683c410-90f8-449e-b966-ecdbc823ece4@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_903_369477850.1412034081120"
X-Trace: ger.gmane.org 1412034097 21937 80.91.229.3 (29 Sep 2014 23:41:37 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 29 Sep 2014 23:41:37 +0000 (UTC)
Cc: gmisocpp@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCOKZ27XTMNRBIW4U6QQKGQEYDZMP3I@isocpp.org Tue Sep 30 01:41:25 2014
Return-path: <std-proposals+bncBCOKZ27XTMNRBIW4U6QQKGQEYDZMP3I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f71.google.com ([209.85.220.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCOKZ27XTMNRBIW4U6QQKGQEYDZMP3I@isocpp.org>)
	id 1XYkZH-0002PY-T7
	for gclcip-std-proposals@m.gmane.org; Tue, 30 Sep 2014 01:41:24 +0200
Original-Received: by mail-pa0-f71.google.com with SMTP id rd3sf35326601pab.10
        for <gclcip-std-proposals@m.gmane.org>; Mon, 29 Sep 2014 16:41:22 -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:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=XH1x+F0K5VIp8G2l6hUhHRRf1NY+rmuc6upsEt9vK2Q=;
        b=i7HVtZNKzWShFBHSzE6hAxsxcIq+NVg8hGHyv8nBY9PpWH/sCAEsFFQLT4x0DtxPRf
         mZ4rZcO4dPnQGOm/oR7iSTcfb8c3zOOMmClYuWhFT2pErPII00W4O58t1Gecvqn/tsoT
         EO+Uq3Q8O4I9yC1TNdhPWXwqlDFXBv3aCBsbY81b7WzKtBpK6ywdEhMmEl5jZGYezRG0
         liQNxAFRe/6MtSHaZ9wcm8vUN7HXo1kjBxn8ldV6feueoCslnokKrjLuWlgZhcaE9tZp
         O65aJ6JvDGP6J89izTEyx0/SNkOieHD0yB0L94wtlCHzl9oNQxSoLrvcwmCoFS5YHjRf
         MBLA==
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:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=XH1x+F0K5VIp8G2l6hUhHRRf1NY+rmuc6upsEt9vK2Q=;
        b=Mu1/wQQsNu3MalFYXRsdH8XLwaxPBC+RuyXBuFot5na1kdhgH9/tdHgTfKVcQgiUb/
         N4DVReqFEl0XW62qLrIF6I+kF/75k7ymeM8gljG0Vq3+LWCs+cEZM9RjjxpuNLGN3h3R
         M+DDtqpGL7ShKFqE3eFt/wadrswQWiCU4AGNayIzhbXfPtEPoatWUEpgCHqQfzddrLGb
         n8AHa7ZIuTRMK1nCkcQo8f5ckll6RItyIivBn2ARsqCSt58htc6EwJwOGZgbZqKcjgsi
         waSk9rgiOtI5ZrfVZQczzGg0oV55tfK13V2jleCTRJU7NhnWruKeMKbuyjr28MIfw7ks
         xEBQ==
X-Gm-Message-State: ALoCoQlGjBCTSPY3h/uOK+R6l9uNqhx0qW4W4orQrooMa4BF1T4WcQAGqu4Bz3hhJsbnuU9oRySm
X-Received: by 10.68.215.73 with SMTP id og9mr36465097pbc.1.1412034082802;
        Mon, 29 Sep 2014 16:41:22 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.82.175 with SMTP id h44ls328042qgd.60.gmail; Mon, 29 Sep
 2014 16:41:22 -0700 (PDT)
X-Received: by 10.140.34.208 with SMTP id l74mr381616qgl.1.1412034082127;
        Mon, 29 Sep 2014 16:41:22 -0700 (PDT)
In-Reply-To: <b683c410-90f8-449e-b966-ecdbc823ece4@isocpp.org>
X-Original-Sender: mizvekov@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: <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:13345
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13345>

------=_Part_903_369477850.1412034081120
Content-Type: text/plain; charset=UTF-8

On Monday, September 29, 2014 8:28:04 PM UTC-3, gmis...@gmail.com wrote:
>
> enum E { a, b, c };
> int f(E e) {
>   // switch cases must cover all enum values or trigger error/warning.
>   switch (e) [[switch_on_all_enum_values]] (E) {
>   case a: return 1;
>   case b: return 2;
>   case c: return 3;
>   }
>

There is something wrong with that example, the (E) seems completely out of 
place with the language, I am not sure if that was intentional.

But otherwise, this seems like an acceptable use of attributes according to 
existing guidelines.
It does not introduce any semantic changes and the attribute can be safely 
ignored.
This would be equivalent to:

enum E { a, b, c };
int f(E e) {
  // switch cases must cover all enum values or trigger error/warning.
  switch (e) {
  case a: return 1;
  case b: return 2;
  case c: return 3;
  default: __builtin_unreachable();
  }

-- 

--- 
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_903_369477850.1412034081120
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, September 29, 2014 8:28:04 PM UTC-3, gmis...@gm=
ail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
><div><div></div>enum E { a, b, c };<br>int f(E e) {<br>&nbsp; // switch ca=
ses must cover all enum values or trigger error/warning.<br>&nbsp; switch (=
e) [[switch_on_all_enum_values]] (E) {<br>&nbsp; case a: return 1;<br>&nbsp=
; case b: return 2;<br>&nbsp; case c: return 3;<br>&nbsp; }</div></div></bl=
ockquote><div><br>There is something wrong with that example, the (E) seems=
 completely out of place with the language, I am not sure if that was inten=
tional.<br><br>But otherwise, this seems like an acceptable use of attribut=
es according to existing guidelines.<br>It does not introduce any semantic =
changes and the attribute can be safely ignored.<br>This would be equivalen=
t to:<br><br><div class=3D"prettyprint" style=3D"background-color: rgb(250,=
 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-w=
idth: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=
=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">enum</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> E =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> b</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> c </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">E e</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>&nbsp; </span><span style=3D"color: #800;" class=3D=
"styled-by-prettify">// switch cases must cover all enum values or trigger =
error/warning.</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br>&nbsp; </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">switch</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">e</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>&nbsp; </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">case</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> a</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">return<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>&nbsp; </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">case</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> b</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">return</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">2</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">case</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> c</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">return</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">3</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp;=
 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">default</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> __builtin_unreachabl=
e</span><span style=3D"color: #660;" class=3D"styled-by-prettify">();</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span></div><=
/code></div></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_903_369477850.1412034081120--

.
