<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jan 18, 2017 7:34 PM, "Akira Hatanaka via Phabricator" <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ahatanak added a comment.<br>
<div class="quoted-text"><br>
In <a href="https://reviews.llvm.org/D28467#649861" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D28467#649861</a>, @krasin wrote:<br>
<br>
> This change makes Clang hardly incompatible with MSVC++. Consider the following program:<br>
><br>
> #include <stdio.h><br>
><br>
> int main(void) {<br>
> const int kDelta = 10000001;<br>
> auto g = [kDelta](int i)<br>
> {<br>
> printf("%d\n", i % kDelta);<br>
> };<br>
> g(2);<br>
> }<br>
><br>
><br>
> Clang will warn about the unused lambda capture:<br>
><br>
> $ clang++ lala.cc -o lala -std=c++14 -Wall -Werror && ./lala<br>
> lala.cc:5:13: error: lambda capture 'kDelta' is not required to be captured for use in an unevaluated context [-Werror,-Wunused-lambda-<wbr>capture]<br>
> auto g = [kDelta](int i)<br>
> ^<br>
> 1 error generated.<br>
><br>
<br>
<br>
</div>Is kDelta considered to be used in an unevaluated context here? I thought unevaluated context in c++ means the expression is used as operands of operators such as typeid and decltype.<br>
<div class="elided-text"></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">It is not used in an unevaluated context -- that is a bug.</div><div dir="auto"><br></div><div dir="auto">~Aaron</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"><br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D28467" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D28467</a><br>
<br>
<br>
<br>
</div></blockquote></div><br></div></div></div>