220 36727 <73c5d690-f05d-4e72-a685-3c55d8be0f8e@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: mihailnajdenov@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Static analysis and the future of C++
Date: Sat, 20 Jan 2018 12:25:13 -0800 (PST)
Lines: 104
Approved: news@gmane.org
Message-ID: <73c5d690-f05d-4e72-a685-3c55d8be0f8e@isocpp.org>
References: <0087c1a4-0b36-40ca-8d43-5bfaf0af62ca@isocpp.org>
 <a395ffbf-fc53-4288-b1ca-f559e1703eac@isocpp.org>
 <88864914-82a8-4a8b-bda7-cffd38379edf@isocpp.org>
 <4fa792ec-1f51-4357-a65a-2ce3c10c60c0@isocpp.org>
 <634a78e7-dc92-4f5e-9105-83339a18b579@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3125_1105812350.1516479913997"
X-Trace: blaine.gmane.org 1516479805 30784 195.159.176.226 (20 Jan 2018 20:23:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 20 Jan 2018 20:23:25 +0000 (UTC)
Cc: mihailnajdenov@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUJ3A7GRAPRBK6LR3JQKGQEJPCLW7I@isocpp.org Sat Jan 20 21:23:21 2018
Return-path: <std-proposals+bncBCUJ3A7GRAPRBK6LR3JQKGQEJPCLW7I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f72.google.com ([209.85.213.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUJ3A7GRAPRBK6LR3JQKGQEJPCLW7I@isocpp.org>)
	id 1eczfU-0007Cb-He
	for gclcip-std-proposals@m.gmane.org; Sat, 20 Jan 2018 21:23:12 +0100
Original-Received: by mail-vk0-f72.google.com with SMTP id w184sf3139681vke.1
        for <gclcip-std-proposals@m.gmane.org>; Sat, 20 Jan 2018 12:25:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        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;
        bh=Mq7G5/086jwLz0svGXDAx4Yisu5WOCAK2ZceiP6MSt4=;
        b=na3NUuWzZ4pUk8GlPsfH24JAIEADq8tnnyfemDmAO1rapzG9fzmd7mB9jpYKFvMXpQ
         i8eEf9Q4x7Zy6PeZv5vLwyZcDoxesrz2QvlhneOyZZiZhcwAiUkEV8njMaZtezAy972T
         Tkk1FXVb6KJyAKjvWZMiDtyey3Zs3rMdLucuWflWXMem2Zd1hN8xtM4T7B18HJ0yN1OJ
         LCvmo98enkOwISbHfz6qBS/OE113UDvenJZbAJaFdLyB2VSE1DUVFskoHRJJ0y+xUnU9
         nMd7M+f0GwP3fnxm6vQj3KV75TgyhvGJLJjwdFWrhqgKjBnApVyIPwrpWxzCE6C8j6Uz
         7wmA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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;
        bh=Mq7G5/086jwLz0svGXDAx4Yisu5WOCAK2ZceiP6MSt4=;
        b=H5C0549Qqge6kHo+u1k7G8TkMLSNRJqPyakX6jrq31fvKFhzu4DfIQdJ3KYuWR7uST
         WOhG+0JDISschrzxyh95ALAbmgygrSv/OD4wVMcnU3iUOOujQLlclYIzwYVxQVMexDj0
         4HjQFFXv6HTszKUWy4ptO1e2PaNSk+aa3vhNQxhJKMUDOgJWJjb9YpZaz+FRBpqrq8KS
         /QTLXSs678SEsuc2R14hrH77Ls4RqDpJv6C6JTmoHHf2jz0Hg6c0Ymy30m0wJXRN6v77
         qilSF6bxbtUKWPPUU89z5FXLcd6hGWOYs3S7lIzEk2OYsaiYVRCcWDVW+kSc3QQq+FKN
         5KFw==
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:cc: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=Mq7G5/086jwLz0svGXDAx4Yisu5WOCAK2ZceiP6MSt4=;
        b=oURXFLxElh+pL6NiP1Lddk3KHwzdK5K37jS44g6B4b/YPbvuKKvSp4oF9zi+CiVgRu
         Irla4BqNcDFSJp9EmwqsgzfAzmr+7nQtWxNxpRmLU1zgCmB+IDJBQtcogEbFcZbz28mz
         FG9QyNgpYNrAZ5e1kj01LlMRFgXit/6tUsYDdpfX9/ux4Z9OqWbJFywyxtax2njThkUV
         5+JIPwk+Q+ML2Ofd5r4wHmeaWFyFrM0aFJHoxk+/Mt5x7ubnfW5X0oVjSRIqQH8v9XT2
         3dMJpmZaxfusVX0HTCAuZCXw/bHgucyAsl0DEg0MVZ2g7f24/aQF1wXzrfSdNaK2fKIA
         kiFw==
X-Gm-Message-State: AKwxytfnnn5rmyHwdrdZVaHT0vqrrzG+cHLYFwD9i2gboorkjBLN4iiW
	ZP0cn1B79ZenLJi22I8RJEicSA==
X-Google-Smtp-Source: AH8x226wHQwYcEQkt7x4UXRwtMqmxnOfwCw2yAUdSvK/CLlrE+BAaik/D+wpCQHWlM7U1NeEZ8TRBA==
X-Received: by 10.176.82.135 with SMTP id v7mr1503900uav.1.1516479916640;
        Sat, 20 Jan 2018 12:25:16 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.176.3.106 with SMTP id 97ls1401834uat.8.gmail; Sat, 20 Jan
 2018 12:25:15 -0800 (PST)
X-Received: by 10.31.161.69 with SMTP id k66mr284898vke.10.1516479914466;
        Sat, 20 Jan 2018 12:25:14 -0800 (PST)
In-Reply-To: <634a78e7-dc92-4f5e-9105-83339a18b579@isocpp.org>
X-Original-Sender: MihailNajdenov@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: <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:36727
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36727>

------=_Part_3125_1105812350.1516479913997
Content-Type: multipart/alternative; 
	boundary="----=_Part_3126_1071090241.1516479913997"

------=_Part_3126_1071090241.1516479913997
Content-Type: text/plain; charset="UTF-8"



On Saturday, January 20, 2018 at 9:31:22 PM UTC+2, Nicol Bolas wrote:
>
> ...
>>
>>
> How would it know? If all the compiler in that translation unit sees is:
>
> class A_view
> {
> public:
>   A_view(const A &p);
>
> private:
>   observer_ptr<A> p_;
> };
>
> How could the compiler* possibly* know that this code is invalid:
>
> A_view v(A{});
>
> We're not talking about runtime detection here; this is purely 
> compile-time. And the compiler doesn't necessarily see everything. If 
> `A_view` is in another translation unit that isn't visible to static 
> analysis, this doesn't work.
>

You have to be more specific, might be my knowledge failing me, but what 
would prevent the compiler seeing in the case when are the dtros of both 
variables called?  

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/73c5d690-f05d-4e72-a685-3c55d8be0f8e%40isocpp.org.

------=_Part_3126_1071090241.1516479913997
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Saturday, January 20, 2018 at 9:31:22 PM UTC+2,=
 Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr">...<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"><div></di=
v></div></blockquote><div><br></div><div>How would it know? If all the comp=
iler in that translation unit sees is:</div><div><br></div><div style=3D"bo=
rder:1px solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(2=
50,250,250)"><code><div><span style=3D"color:#008">class</span><span style=
=3D"color:#000"> A_view<br></span><span style=3D"color:#660">{</span><span =
style=3D"color:#000"><br></span><span style=3D"color:#008">public</span><sp=
an style=3D"color:#660">:</span><span style=3D"color:#000"><br>=C2=A0 A_vie=
w</span><span style=3D"color:#660">(</span><span style=3D"color:#008">const=
</span><span style=3D"color:#000"> A </span><span style=3D"color:#660">&amp=
;</span><span style=3D"color:#000">p</span><span style=3D"color:#660">);</s=
pan><span style=3D"color:#000"><br><br></span><span style=3D"color:#008">pr=
ivate</span><span style=3D"color:#660">:</span><span style=3D"color:#000"><=
br>=C2=A0 observer_ptr</span><span style=3D"color:#660">&lt;</span><span st=
yle=3D"color:#000">A</span><span style=3D"color:#660">&gt;</span><span styl=
e=3D"color:#000"> p_</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#660">};</span></div></code=
></div><div><br></div><div>How could the compiler<i> possibly</i> know that=
 this code is invalid:</div><div><br></div><div style=3D"border:1px solid r=
gb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><co=
de><div><span style=3D"color:#000">A_view v</span><span style=3D"color:#660=
">(</span><span style=3D"color:#000">A</span><span style=3D"color:#660">{})=
;</span><span style=3D"color:#000"><br></span></div></code></div><br><div>W=
e&#39;re not talking about runtime detection here; this is purely compile-t=
ime. And the compiler doesn&#39;t necessarily see everything. If `A_view` i=
s in another translation unit that isn&#39;t visible to static analysis, th=
is doesn&#39;t work.</div></div></blockquote><div><br></div><div style=3D"t=
ext-align: left;">You have to be more specific, might be my knowledge faili=
ng me, but what would prevent the compiler seeing in the case when are the =
dtros of both variables called? =C2=A0</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/73c5d690-f05d-4e72-a685-3c55d8be0f8e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/73c5d690-f05d-4e72-a685-3c55d8be0f8e=
%40isocpp.org</a>.<br />

------=_Part_3126_1071090241.1516479913997--

------=_Part_3125_1105812350.1516479913997--

.
