220 34843 <fb43bfaa-b153-34f1-8c3f-63800d3f391e@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: diagnosing "unused" variables that are only constructed
Date: Thu, 12 Oct 2017 18:11:17 -0400
Lines: 33
Approved: news@gmane.org
Message-ID: <fb43bfaa-b153-34f1-8c3f-63800d3f391e@gmail.com>
References: <e253e302-04f0-4c18-9c0e-7b0adb8f5f26@isocpp.org>
 <f6996a18-db4c-b57c-77ea-7119a3e5145d@gmail.com>
 <ed8e9f0c-5182-42b0-ab86-e62538d5b074@isocpp.org>
 <01889e44-d529-1852-b0a0-a69484b5783f@gmail.com>
 <a24104df-4d12-4925-b3ba-be08ecc014cc@isocpp.org>
 <90d0428b-f5a1-3749-b9cd-b0cbeac5f422@gmail.com>
 <f50db722-7b91-4218-92e9-43b90f51e88a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1507846285 22114 195.159.176.226 (12 Oct 2017 22:11:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 12 Oct 2017 22:11:25 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.3.0
Cc: gmisocpp@gmail.com
To: std-proposals@isocpp.org, janwilmans@gmail.com
Original-X-From: std-proposals+bncBC37LBFWUIFBBCGR77HAKGQET2LN6UA@isocpp.org Fri Oct 13 00:11:21 2017
Return-path: <std-proposals+bncBC37LBFWUIFBBCGR77HAKGQET2LN6UA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f198.google.com ([209.85.216.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBCGR77HAKGQET2LN6UA@isocpp.org>)
	id 1e2lhC-0004Jb-5O
	for gclcip-std-proposals@m.gmane.org; Fri, 13 Oct 2017 00:11:14 +0200
Original-Received: by mail-qt0-f198.google.com with SMTP id y45sf12913796qty.17
        for <gclcip-std-proposals@m.gmane.org>; Thu, 12 Oct 2017 15:11:21 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1507846281; cv=pass;
        d=google.com; s=arc-20160816;
        b=R9ZSNGSDEEL8MI4vDxsGxH1jTEUeOBiC8CP5KZZ6HVwG+P0Ir6RkApD1HhlmyjZ5zx
         j2UuYZLVdE0kBv/Y1WNpX0BL/cEZ13lW+3la0RJNfiU/cuyJ19bFkKU6xcpXejAJvS8P
         iR/dXkwwwM/McO3dlRhnUcloEJp2BgeH6wuK6r9WkkRtjRxuqwLbtCdCKUPp641studJ
         en94apP/Hxx7tVe+uHFugs20X8p3Iq9ZkN1r6ovUUPCsetlcesiaY/N8jFL/h1tlkNAE
         6yKdDmomqUvT3SasApozdVn65HuJLGgN4PS5AbZ+lxG+0lQDp6lrxi+ulRMF7FfMhQ57
         EbgQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-language
         :in-reply-to:mime-version:user-agent:date:message-id:from:references
         :newsgroups:cc:to:subject:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=tPWgRGCMKhmKFKs+NEiGEX/2URlUnIUVFQY7WZ2Csmc=;
        b=FIaRmvI8QqIf4hATif5RNe9w/2C7Y9yYyRYEs//kQVO+Tm6FM10tABYDj7MvSUZUwC
         H1wxoKb7iQP5uTJlabuSIPsDJwJLdob6LRH84W7Z9UHtp75U/70K9RtjVqDBia9dVI09
         aKjKiZhaQw2Ezwtwx4w763ZXYgh6kJ2Jixh6wJvMQ+dqy/89Xj/eTSlLtrQleHnr4YX7
         4fKUFB1c/KdfEdoXu0+0WXL4bwIUtulJ1cRX3boc7v617iunMA7sRRmQH5K88yWoKndm
         JAqwv0cbwiFh1YXj0Z/d4aBec5SyY8SMefQN3wV339kJJtO0yQ8dAanp+pGwvgMtmgpf
      
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=cpNGN5ZT;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:cc:newsgroups:references:from:message-id:date:user-agent
         :mime-version:in-reply-to:content-language:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=tPWgRGCMKhmKFKs+NEiGEX/2URlUnIUVFQY7WZ2Csmc=;
        b=iKklsMuM/xJ8ur2GUBVi8hptuiPJyaYqt42OylJG4h1S6WakzzvQppeLKpT0dY58Do
         ijHVDlU507rvWhi13cftMf6zkXKNb3+0WpD34EBAryB5HsZzQqkK1kx5rprgdHoBuHai
         mJ0M86+LZ7BjRKzi5PFYlsTycuzXY6s+tII6S76CVhEJvz9HXu4yzYGk6FLyZwTQ2m/0
         e/ZXkKtISG2Kqn7ojffbht+ZC7NpM9npl3t7XU3ariLRI6WLFZWelW5UAq7nqwSrb/cI
         b1bhyJ7LUcXAmsz9jvWUagqekJq2fudY1RyBPuIoD2egCAQnm9EAgVYduaOx1MtmH9I1
         Wu7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:cc:newsgroups:references:from
         :message-id:date:user-agent:mime-version:in-reply-to
         :content-language:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=tPWgRGCMKhmKFKs+NEiGEX/2URlUnIUVFQY7WZ2Csmc=;
        b=EZYy3/Re5xpMj4nWlaNfZOwppJcMEJnjSdQisCHPsshrpJ2WavvuAyk1SbfT3y4DS/
         lSibVN1sSK4hWVZNiJTm97owvZZufudEina7B8pH1g9pdYqwGtLm9R+ofxkbAQbyAYuA
         7YVCUi96F5ItA26BM+hFMhJP68YeLoGTBC4AKpSq9to0/nAHjC9LVI369x8/HJcL+Iq8
         XxsGRjNjKK2bQH8h2uPNqbuNV+tDA1+UTvZe93OSvFPUMs3KZLzYzI9fiUrlSPZ/2VcK
         q63jlfaq7qb6H4fvz7+1miAuGwxRkW9n+FD4yESogmAo0fl0xLOqYgx 
X-Gm-Message-State: AMCzsaUKVVRfJXm59UoUlOp12wYBR8smEC8JDT9zfTuG6DLvGloFGsGn
	8bRx+BVsNQzyZ2Oh8VV7gr8wHg==
X-Google-Smtp-Source: AOwi7QBQaEhOLme3H6lHm5Z5gg+A1PqIs6+VsAF04Rp8nN496EXnITHoL7ks+27awgZV50CzA7AZdQ==
X-Received: by 10.129.145.72 with SMTP id i69mr7380483ywg.110.1507846281273;
        Thu, 12 Oct 2017 15:11:21 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.129.226.65 with SMTP id z1ls292456ywl.26.gmail; Thu, 12 Oct
 2017 15:11:20 -0700 (PDT)
X-Received: by 10.129.155.22 with SMTP id s22mr2750906ywg.491.1507846280355;
        Thu, 12 Oct 2017 15:11:20 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1507846280; cv=none;
        d=google.com; s=arc-20160816;
        b=l56Bke+LWptBny0L8dK1L6RugZSwX88GPmoC7ecHYffx8+hqkBJAk5YhidA32yhsF2
         g5pviiW45kiki2xKaEA+WHQdlBe0DYxxo/OfrF9+xxvKPBzMmmT+ui2/3z9MUH410ID8
         EFUdP8j/Fdl/xBFch0heeVn8AGPg2RDVS2Et0ndQG4h8yj3TaYZ3iS7V1QcbWd9Mg0LC
         iuxxWC9LEpKLU62Gy6JQTjXCedfEo01YK7gJcibhrLNbDN/EtfZDSwyRb4M3d/f0lF5t
         fDZAx0vHgU6dS3uHh0ybP2fJ7E+l36W5CYqcaD31lwaCy471Bw8vitRnw/DUNGNcav3m
         8L4A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:from:references:newsgroups:cc:to:subject
         :dkim-signature:arc-authentication-results;
        bh=s92D89luq2WnB7U+Dj+5B9iMnRX3+ZvaB/6jNP6yMNY=;
        b=b1vUmh8pSYr+hCvWGXNCb0ehP6BBWKZ4efSJsyYzryUxi+n5sXtuPgDNRP2F/qZSQW
         Ubm5IDvNVuynzJf2bdsDNM8WwX1UrMr1M0YFYeDPnkh6BfUFwnzEqxUlWAAU/OeTFrW2
         f5xXX1UxfmXxqL8zdkG6zX29wKAaKNvIPE6e39r1jBHow525kjvbTl/QJFPsP+FVnUxg
         H1eVdjgeVKpVWwzM1tRJbGd347CYLANkUN2/ixGlfZol0ECvSPHDoyK6/Lk6wyZJJls2
         Y6rfAP6BR1pwnUud+oW9hr1Kx16L/TrPp5eV0ndf1NftlPUOyVNQXeXFQkaVC6teM5ic
         ABog==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=cpNGN5ZT;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id q3sor9405791ywe.450.2017.10.12.15.11.20
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Thu, 12 Oct 2017 15:11:20 -0700 (PDT)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.129.128.67 with SMTP id q64mr2760566ywf.420.1507846280153;
        Thu, 12 Oct 2017 15:11:20 -0700 (PDT)
Original-Received: from gryphon.kitware.com (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id l66sm6742652ywd.98.2017.10.12.15.11.19
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 12 Oct 2017 15:11:19 -0700 (PDT)
Original-Newsgroups: gmane.comp.lang.c++.isocpp.proposals
In-Reply-To: <f50db722-7b91-4218-92e9-43b90f51e88a@isocpp.org>
Content-Language: en-US
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=cpNGN5ZT;       spf=pass
 (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;       dmarc=pass
 (p=NONE sp=NONE dis=NONE) header.from=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:34843
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34843>

On 2017-10-12 17:46, janwilmans@gmail.com wrote:
> What I was suggesting is that by introducing a syntax to explicitly make 
> something unnamed, the compiler would then be free to emit warnings for all 
> other cases where an object is not referenced after construction, without 
> needed to evaluate whether the constructor/destruction has side-effects or 
> not.
> 
> This is what you wanted right?

Yeeeee...maybe? I seem to recall that defining "not referenced after
construction" was not so simple as it seems.

> On the other hand, I don't really see the value in putting that specific 
> warning in the standard itself, but any compiler would be free do to do it 
> and it would be easier to implement.

In any case, I don't think the standard would have anything stronger
than a suggestion regarding warnings. (IIRC, there is anyway no such
thing as a "warning" in the standard.) What would be proposed would be
an attribute to annotate types that should not produce such warnings.

IOW, the only actual *standardese* would be that an attribute with
such-and-such name exists.

-- 
Matthew

-- 
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/fb43bfaa-b153-34f1-8c3f-63800d3f391e%40gmail.com.

.
