[cfe-dev] libclang crash when parsing MS-style inline assembly

Kim Gräsman kim.grasman at gmail.com
Sat Nov 9 01:23:23 PST 2013


On Sat, Nov 9, 2013 at 10:10 AM, Kim Gräsman <kim.grasman at gmail.com> wrote:
> On Fri, Nov 8, 2013 at 8:52 PM, Reid Kleckner <rnk at google.com> wrote:
>>
>> Muahahaha:
>>
>> // foo.h
>> struct Foo {
>>   static const int x = 20;
>> };
>> // foo.cc
>> int main() {
>>   int r;
>>   __asm {
>>     mov ecx, Foo::x
>>     mov r, ecx
>>   };
>>   return r;
>> }
>>
>> Seems like a use that is relevant to IWYU.  :)
>
> Count on compiler developers to prove me wrong :-)
>
> Patches most welcome!

Actually, it turns out this already works in IWYU.

So we'll just keep the InitializeNativeTarget* calls in main(), and
life is good!

- Kim




More information about the cfe-dev mailing list