Topic: Add a [[removed]] attribute..
Author: 3dw4rd@verizon.net
Date: Wed, 24 Dec 2014 17:52:03 -0800 (PST)
Raw View
------=_Part_1501_1806331914.1419472323542
Content-Type: multipart/alternative;
boundary="----=_Part_1502_44160959.1419472323542"
------=_Part_1502_44160959.1419472323542
Content-Type: text/plain; charset=UTF-8
Now that C++14 is out with attribute [[deprecated]] and now that C++17 is
moving forward with some removals of library features it seems lie a good
idea to at least consider a [[removed]] attribute that could take a
message. This would allow an implementation to provide stronger dissuasion
including compilation fail than [[deprecated]]. This allows finer grain
control over the status of features.
As for implementation experience IIRC Clang has something like this.
#if __cplusplus == 201402
int foo() [[deprecated("This function is deprecated and will be removed
in a later")]];
#elif __cplusplus > 201402
int foo() [[removed("This function is removed. Use bar() instead")]];
#endif
What do you all think?
Ed
--
---
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_1502_44160959.1419472323542
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Now that C++14 is out with attribute [[deprecated]] and no=
w that C++17 is moving forward with some removals of library features it se=
ems lie a good idea to at least consider a [[removed]] attribute that could=
take a message. This would allow an implementation to provide strong=
er dissuasion including compilation fail than [[deprecated]]. This al=
lows finer grain control over the status of features.<br><br>As for impleme=
ntation experience IIRC Clang has something like this.<br><br>#if __cpluspl=
us =3D=3D 201402<br> int foo() [[deprecated("This function is depreca=
ted and will be removed in a later")]];<br>#elif __cplusplus > 201402<br=
> int foo() [[removed("This function is removed. Use bar() inst=
ead")]];<br>#endif<br><br>What do you all think?<br><br>Ed<br><br><br></div=
>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_1502_44160959.1419472323542--
------=_Part_1501_1806331914.1419472323542--
.
Author: masse.nicolas@gmail.com
Date: Thu, 25 Dec 2014 04:02:32 -0800 (PST)
Raw View
------=_Part_5681_369766474.1419508952349
Content-Type: multipart/alternative;
boundary="----=_Part_5682_1994937747.1419508952349"
------=_Part_5682_1994937747.1419508952349
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
#if __cplusplus =3D=3D 201402
[[deprecated("This function is deprecated and will be removed in a later"
)]]
int foo();
#elif __cplusplus > 201402
[[deprecated("Please use bar() instead")]]
int foo() =3D delete;
#endif
Le jeudi 25 d=C3=A9cembre 2014 02:52:03 UTC+1, 3dw...@verizon.net a =C3=A9c=
rit :
>
> Now that C++14 is out with attribute [[deprecated]] and now that C++17 is=
=20
> moving forward with some removals of library features it seems lie a good=
=20
> idea to at least consider a [[removed]] attribute that could take a=20
> message. This would allow an implementation to provide stronger dissuasi=
on=20
> including compilation fail than [[deprecated]]. This allows finer grain=
=20
> control over the status of features.
>
> As for implementation experience IIRC Clang has something like this.
>
> #if __cplusplus =3D=3D 201402
> int foo() [[deprecated("This function is deprecated and will be removed=
=20
> in a later")]];
> #elif __cplusplus > 201402
> int foo() [[removed("This function is removed. Use bar() instead")]];
> #endif
>
> What do you all think?
>
> Ed
>
>
>
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_5682_1994937747.1419508952349
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"prettyprint" style=3D"background-color: =
rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; =
border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div=
class=3D"subprettyprint"><span style=3D"color: #800;" class=3D"styled-by-p=
rettify">#if __cplusplus =3D=3D 201402</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br></span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><code class=3D"prettyprint"><span style=3D"color: #=
000;" class=3D"styled-by-prettify"></span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify"> [[</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">deprecated</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #080;" class=3D"style=
d-by-prettify">"This function is deprecated and will be removed in a later"=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)]]<br></s=
pan></code> </span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> foo</span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">#elif</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> __cplusplus </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">></span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066=
;" class=3D"styled-by-prettify">201402</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br></span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><code class=3D"prettyprint"><span style=3D"color: #=
660;" class=3D"styled-by-prettify"> [[</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">deprecated</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">(</span><span style=3D"color: #080;" clas=
s=3D"styled-by-prettify">"Please use bar() instead"</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">)]]</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br></span></code> </span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> foo</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">delete</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span=
><span style=3D"color: #800;" class=3D"styled-by-prettify">#endif</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></c=
ode></div><br><br><br>Le jeudi 25 d=C3=A9cembre 2014 02:52:03 UTC+1, 3dw...=
@verizon.net a =C3=A9crit :<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">Now that C++14 is out with attribute [[deprecated]] and =
now that C++17 is moving forward with some removals of library features it =
seems lie a good idea to at least consider a [[removed]] attribute that cou=
ld take a message. This would allow an implementation to provide stro=
nger dissuasion including compilation fail than [[deprecated]]. This =
allows finer grain control over the status of features.<br><br>As for imple=
mentation experience IIRC Clang has something like this.<br><br>#if __cplus=
plus =3D=3D 201402<br> int foo() [[deprecated("This function is depre=
cated and will be removed in a later")]];<br>#elif __cplusplus > 201402<=
br> int foo() [[removed("This function is removed. Use bar() in=
stead")]];<br>#endif<br><br>What do you all think?<br><br>Ed<br><br><br></d=
iv></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_5682_1994937747.1419508952349--
------=_Part_5681_369766474.1419508952349--
.
Author: peggysr@gmail.com
Date: Thu, 25 Dec 2014 10:28:54 -0800 (PST)
Raw View
------=_Part_5130_1723107125.1419532134897
Content-Type: multipart/alternative;
boundary="----=_Part_5131_1444470080.1419532134897"
------=_Part_5131_1444470080.1419532134897
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Thursday, December 25, 2014 7:02:32 AM UTC-5, masse....@gmail.com wrote:
>
>
> #if __cplusplus =3D=3D 201402
> [[deprecated("This function is deprecated and will be removed in a=20
> later")]]
> int foo();
> #elif __cplusplus > 201402
> [[deprecated("Please use bar() instead")]]
> int foo() =3D delete;
> #endif
>
> My point is that instead of a warning you might want something different=
=20
to happen on the second line - like a hard error. An alternative would be=
=20
to add another arg to [[deprecated]] that would signal error. My feeling=
=20
if the word removed in a concept in the standard like deprecated it should=
=20
have support.=20
>
>
> Le jeudi 25 d=C3=A9cembre 2014 02:52:03 UTC+1, 3dw...@verizon.net a =C3=
=A9crit :
>>
>> Now that C++14 is out with attribute [[deprecated]] and now that C++17 i=
s=20
>> moving forward with some removals of library features it seems lie a goo=
d=20
>> idea to at least consider a [[removed]] attribute that could take a=20
>> message. This would allow an implementation to provide stronger dissuas=
ion=20
>> including compilation fail than [[deprecated]]. This allows finer grain=
=20
>> control over the status of features.
>>
>> As for implementation experience IIRC Clang has something like this.
>>
>> #if __cplusplus =3D=3D 201402
>> int foo() [[deprecated("This function is deprecated and will be remove=
d=20
>> in a later")]];
>> #elif __cplusplus > 201402
>> int foo() [[removed("This function is removed. Use bar() instead")]];
>> #endif
>>
>> What do you all think?
>>
>> Ed
>>
>>
>>
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_5131_1444470080.1419532134897
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Thursday, December 25, 2014 7:02:32 AM UTC-5, m=
asse....@gmail.com 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"><br><div style=3D"background-color:rgb(250,250,250);border-colo=
r:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word=
"><code><div><span style=3D"color:#800">#if __cplusplus =3D=3D 201402</span=
><span style=3D"color:#000"><br></span><span style=3D"color:#000"><code><sp=
an style=3D"color:#000"></span><span style=3D"color:#660"> [[</span><=
span style=3D"color:#000">deprecated</span><span style=3D"color:#660">(</sp=
an><span style=3D"color:#080">"This function is deprecated and will be remo=
ved in a later"</span><span style=3D"color:#660">)]]<br></span></code> =
; </span><span style=3D"color:#008">int</span><span style=3D"color:#000"> f=
oo</span><span style=3D"color:#660">()</span><span style=3D"color:#660">;</=
span><span style=3D"color:#000"><br></span><span style=3D"color:#800">#elif=
</span><span style=3D"color:#000"> __cplusplus </span><span style=3D"color:=
#660">></span><span style=3D"color:#000"> </span><span style=3D"color:#0=
66">201402</span><span style=3D"color:#000"><br></span><span style=3D"color=
:#000"><code><span style=3D"color:#660"> [[</span><span style=3D"colo=
r:#000">deprecated</span><span style=3D"color:#660">(</span><span style=3D"=
color:#080">"Please use bar() instead"</span><span style=3D"color:#660">)]]=
</span><span style=3D"color:#000"><br></span></code> </span><span sty=
le=3D"color:#008">int</span><span style=3D"color:#000"> foo</span><span sty=
le=3D"color:#660">()</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=3D=
"color:#008">delete</span><span style=3D"color:#660">;</span><span style=3D=
"color:#000"><br></span><span style=3D"color:#800">#endif</span><span style=
=3D"color:#000"><br></span></div></code></div><br></div></blockquote><div>M=
y point is that instead of a warning you might want something different to =
happen on the second line - like a hard error. An alternative would b=
e to add another arg to [[deprecated]] that would signal error. My fe=
eling if the word removed in a concept in the standard like deprecated it s=
hould have support. <br></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">=
<div dir=3D"ltr"><br><br>Le jeudi 25 d=C3=A9cembre 2014 02:52:03 UTC+1, <a>=
3dw...@verizon.net</a> a =C3=A9crit :<blockquote class=3D"gmail_quote"=
style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><div dir=3D"ltr">Now that C++14 is out with attribute [[deprecated]]=
and now that C++17 is moving forward with some removals of library feature=
s it seems lie a good idea to at least consider a [[removed]] attribute tha=
t could take a message. This would allow an implementation to provide=
stronger dissuasion including compilation fail than [[deprecated]]. =
This allows finer grain control over the status of features.<br><br>As for =
implementation experience IIRC Clang has something like this.<br><br>#if __=
cplusplus =3D=3D 201402<br> int foo() [[deprecated("This function is =
deprecated and will be removed in a later")]];<br>#elif __cplusplus > 20=
1402<br> int foo() [[removed("This function is removed. Use bar=
() instead")]];<br>#endif<br><br>What do you all think?<br><br>Ed<br><br><b=
r></div></blockquote></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_5131_1444470080.1419532134897--
------=_Part_5130_1723107125.1419532134897--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 25 Dec 2014 20:51:49 +0200
Raw View
On 25 December 2014 at 20:28, <peggysr@gmail.com> wrote:
> On Thursday, December 25, 2014 7:02:32 AM UTC-5, masse....@gmail.com wrote:
>> #if __cplusplus == 201402
>> [[deprecated("This function is deprecated and will be removed in a
>> later")]]
>> int foo();
>> #elif __cplusplus > 201402
>> [[deprecated("Please use bar() instead")]]
>> int foo() = delete;
>> #endif
> My point is that instead of a warning you might want something different to
> happen on the second line - like a hard error. An alternative would be to
The standard talks about "diagnostics", it doesn't make a difference
between a "warning" and an "error". However, the first branch is well-formed
with implementation-defined behaviour wrt the attribute, whereas the
second branch means that using 'foo' is ill-formed (and a diagnostic
is required), also providing the same implementation-defined behaviour
wrt the attribute. In other words, it gives you exactly what you want,
practically.
> add another arg to [[deprecated]] that would signal error. My feeling if
> the word removed in a concept in the standard like deprecated it should have
> support.
It's unlikely that any attribute would be guaranteed to produce a diagnostic.
--
---
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/.
.