<div dir="ltr">LGTM, do you need someone to commit this for you?<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 18, 2014 at 12:28 AM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 12/17/2014 08:40 PM, Richard Smith wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The right way to write this is:<br>
<br>
- if (const EnumType *ET = dyn_cast<EnumType>(T))<br>
+ if (const EnumType *ET = T->getAs<EnumType>())<br>
</blockquote>
<br></span>
updated patch attached<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On Tue, Dec 16, 2014 at 5:51 AM, Rafael Espíndola<br></span><span class="">
<<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a> <mailto:<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@<u></u>gmail.com</a>>> wrote:<br>
<br>
LGTM.<br>
<br>
Clang is not my expertise, but the patch looks clearly correct, fixes<br>
a bug and has a testcase.<br>
<br>
<br>
On 16 December 2014 at 04:49, Stephan Bergmann <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a><br></span>
<mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>> wrote:<br>
> ping<br>
><br>
><span class=""><br>
> On 11/25/2014 03:04 PM, Rafael Espíndola wrote:<br>
>><br>
>> ccing Richard.<br>
>> On 25 November 2014 at 03:38, Stephan Bergmann<br></span>
<<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>><span class=""><br>
>> wrote:<br>
>>><br>
>>> ping<br>
>>><br>
>>><br>
>>> On 11/10/2014 06:18 PM, Stephan Bergmann wrote:<br>
>>>><br>
>>>><br>
>>>> On 10/23/2014 10:41 AM, David Majnemer wrote:<br>
>>>>><br>
>>>>><br>
>>>>> Per the developer policy [1], please add a test case to<br>
accompany your<br>
>>>>> change.<br>
>>>>><br>
>>>>> [1] <a href="http://llvm.org/docs/DeveloperPolicy.html#test-cases" target="_blank">http://llvm.org/docs/<u></u>DeveloperPolicy.html#test-<u></u>cases</a><br>
>>>>><br>
>>>>> Looks good otherwise.<br>
>>>><br>
>>>><br>
>>>><br>
>>>> Attached updated patch including test case.<br>
>>>><br>
>>>>> On Thu, Oct 23, 2014 at 12:43 AM, Stephan Bergmann<br>
<<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>><br></span><div><div class="h5">
>>>>> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>>> wrote:<br>
>>>>><br>
>>>>> [ping]<br>
>>>>><br>
>>>>><br>
>>>>> On 10/14/2014 04:12 PM, Stephan Bergmann wrote:<br>
>>>>><br>
>>>>> $ clang++ --version<br>
>>>>> clang version 3.6.0 (trunk 219190)<br>
>>>>> Target: x86_64-unknown-linux-gnu<br>
>>>>> Thread model: posix<br>
>>>>><br>
>>>>> $ cat test.cc<br>
>>>>> enum class E { e };<br>
>>>>> typedef E E2;<br>
>>>>> E2 f1() { return E::e; }<br>
>>>>> E f2() { return E::e; }<br>
>>>>> bool g1() { return !f1(); }<br>
>>>>> bool g2() { return !f2(); }<br>
>>>>><br>
>>>>> $ clang++ -std=c++11 -c test.cc<br>
>>>>> test.cc:6:20: error: invalid argument type 'E'<br>
to unary<br>
>>>>> expression<br>
>>>>> bool g2() { return !f2(); }<br>
>>>>> ^~~~~<br>
>>>>> 1 error generated.<br>
>>>>><br>
>>>>><br>
>>>>> rightly complains about the invalid contextual<br>
conversion to<br>
>>>>> bool in g2<br>
>>>>> but erroneously not also about the one in g1.<br>
>>>>><br>
>>>>> Index: lib/Sema/SemaExpr.cpp<br>
>>>>><br>
>>>>><br>
==============================<u></u>__============================<u></u>==__=======<br>
>>>>> --- lib/Sema/SemaExpr.cpp (revision 219190)<br>
>>>>> +++ lib/Sema/SemaExpr.cpp (working copy)<br>
>>>>> @@ -7414,7 +7414,7 @@<br>
>>>>> }<br>
>>>>><br>
>>>>> static bool isScopedEnumerationType(__<u></u>QualType<br>
T) {<br>
>>>>> - if (const EnumType *ET = dyn_cast<EnumType>(T))<br>
>>>>> + if (const EnumType *ET =<br>
>>>>> dyn_cast<EnumType>(T.__<u></u>getCanonicalType()))<br>
>>>>><br>
>>>>> return ET->getDecl()->isScoped();<br>
>>>>> return false;<br>
>>>>> }<br>
>>>>><br>
>>>>><br>
>>>>> would fix that for me.<br>
</div></div></blockquote>
<br>
</blockquote></div></div></div>