Richard, great catch! I've added code and a test to address it.

================
Comment at: test/CodeGenCXX/mangle-ms.cpp:252
@@ +251,3 @@
+    int a_field;
+  } static_variable_in_inline_function = { 20 };
+  // CHECK: 
@"\01?static_variable_in_inline_function@?1??inline_function_with_local_type@@YAHXZ@4U<unnamed-type-static_variable_in_inline_function>@?1??1@YAHXZ@A"
----------------
Reid Kleckner wrote:
> You can improve on this with:
>   inline int inline_function_with_local_type() {
>     static struct {
>       int a_field;
>     } static_variable_in_inline_function = { 20 }, second_static = { 40 };
>     return static_variable_in_inline_function.a_field + second_static.a_field;
>   }
> 
> I verified that cl.exe uses the first variable name in the type.
Addressed in my last commit.


http://llvm-reviews.chandlerc.com/D1540
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to