<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Further clarification, “Long Lived” (PM actually said ‘a while’ to me) means “weeks/months”, so consider that as you will.<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Keane, Erich
<br>
<b>Sent:</b> Thursday, April 5, 2018 10:26 AM<br>
<b>To:</b> Clang Dev <cfe-dev@lists.llvm.org><br>
<b>Subject:</b> RE: [cfe-dev] Wish: Split Wunused-lambda-capture<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I just got word back from a PM at Microsoft, apparently fixing this bug is not an easy one (seemingly would require architectural changes), and so this is likely
 going to be a long lived bug in MSVC.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I tend to agree completely with Aaron in that thread, but I wanted to make sure we have this context in case we revisit.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">-Erich<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><a href="mailto:thakis@google.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">thakis@google.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> [</span><a href="mailto:thakis@google.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:thakis@google.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<b>On Behalf Of </b>Nico Weber<br>
<b>Sent:</b> Thursday, April 5, 2018 10:07 AM<br>
<b>To:</b> Tobias Hahn <</span><a href="mailto:tobias.hahn@ableton.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">tobias.hahn@ableton.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Cc:</b> Keane, Erich <</span><a href="mailto:erich.keane@intel.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">erich.keane@intel.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>; Clang Dev <</span><a href="mailto:cfe-dev@lists.llvm.org"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">cfe-dev@lists.llvm.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">>;
 Aaron Ballman <</span><a href="mailto:aaron.ballman@gmail.com"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">aaron.ballman@gmail.com</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Subject:</b> Re: [cfe-dev] Wish: Split Wunused-lambda-capture<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">This was discussed when the warning was added. I felt the same way, but Aaron convinced me that this is short ("short") term pain:<o:p></o:p></p>
<div>
<p class="MsoNormal"><a href="http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20170116/183259.html">http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20170116/183259.html</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://marc.info/?l=cfe-commits&m=148521057007058&w=2">https://marc.info/?l=cfe-commits&m=148521057007058&w=2</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://marc.info/?l=cfe-commits&m=148546938216504&w=2">https://marc.info/?l=cfe-commits&m=148546938216504&w=2</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">We disabled the warning for now in Chromium.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Apr 5, 2018 at 12:50 PM, Tobias Hahn via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal">I did that as well as posting my wish here, let's see...<br>
<span style="color:#888888"><br>
<span class="hoenzb">T</span></span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
> Am 05.04.2018 um 17:54 schrieb Keane, Erich via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>>:<br>
><br>
> " Since I don't expect MSVC to be standards compliant any time soon,"<br>
><br>
> I think you may wish to report this as a bug to the MSVC team.  They have been REALLY good about fixing standards compliance issues in the past two years or so.<br>
><br>
> -----Original Message-----<br>
> From: cfe-dev [mailto:<a href="mailto:cfe-dev-bounces@lists.llvm.org">cfe-dev-bounces@lists.llvm.org</a>] On Behalf Of Tobias Hahn via cfe-dev<br>
> Sent: Thursday, April 5, 2018 8:50 AM<br>
> To: <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> Subject: [cfe-dev] Wish: Split Wunused-lambda-capture<br>
><br>
> In migrating our codebase to Xcode 9.3, I came across the new warning -Wunused-lambda-capture. This seems like a helpful warning to enable; yet unfortunately I cannot due to incompatibility with MSVC.<br>
><br>
> The problem is that it warns on the following code (<a href="https://godbolt.org/g/HDiqR8" target="_blank">https://godbolt.org/g/HDiqR8</a>):<br>
><br>
> int times2(int num) {<br>
>  const int two = 2;<br>
>  auto multiply = [two](int i) { return i * two; };<br>
>  return multiply(num);<br>
> }<br>
><br>
> Per the standard, it is unnecessary to capture `two` because it is an integral constant. MSVC doesn't know about this, and throws C3493 (variable cannot be implicitly captured) if I remove `two` from the capture clause to fix clang's -Wunused-lambda-capture
 (<a href="https://godbolt.org/g/VNNfqT" target="_blank">https://godbolt.org/g/VNNfqT</a>).<br>
><br>
> Since I don't expect MSVC to be standards compliant any time soon, it would be great if this warning could be split into two warnings:<br>
><br>
> -Wunused-lambda-capture would only warn on truly unused captures, but not captures that are merely unnecessary (but still used as in the example above).<br>
><br>
> -Wunnecessary-lambda-capture would warn on redundant explicit captures (as in the example above).<br>
><br>
> Thanks for considering my wish and making clang even better!<br>
><br>
> Tobias<br>
><br>
> Ableton AG, Schoenhauser Allee 6-7, 10119 Berlin, Germany Sitz (Registered Office) Berlin, Amtsgericht Berlin-Charlottenburg, HRB 72838 Vorstand (Management Board): Gerhard Behles, Jan Bohl Vorsitzender des Aufsichtsrats (Chair of the Supervisory Board):
 Uwe Struck<br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br>
Ableton AG, Schoenhauser Allee 6-7, 10119 Berlin, Germany<br>
Sitz (Registered Office) Berlin, Amtsgericht Berlin-Charlottenburg, HRB 72838<br>
Vorstand (Management Board): Gerhard Behles, Jan Bohl<br>
Vorsitzender des Aufsichtsrats (Chair of the Supervisory Board): Uwe Struck<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>