Boost C++ Libraries: Ticket #5025: BOOST_TYPEOF VS2008 Internal Compiler Error https://svn.boost.org/trac10/ticket/5025 <p> Visual Studio 2008 crashes (C1001: An internal error has occurred in the compiler) when compiling the following code: </p> <p> #include &lt;boost/typeof/typeof.hpp&gt; </p> <p> struct S { </p> <blockquote> <p> virtual void f() = 0; typedef BOOST_TYPEOF(&amp;S::f) T; </p> </blockquote> <p> }; </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5025 Trac 1.4.3 Steven Watanabe Fri, 31 Dec 2010 17:40:09 GMT component changed; owner set https://svn.boost.org/trac10/ticket/5025#comment:1 https://svn.boost.org/trac10/ticket/5025#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peder Holt</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">typeof</span> </li> </ul> <p> Are you using native typeof or typeof emulation? </p> Ticket Mike Spertus <mike_spertus@…> Sat, 01 Jan 2011 19:12:44 GMT <link>https://svn.boost.org/trac10/ticket/5025#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5025#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5025#comment:1" title="Comment 1">steven_watanabe</a>: </p> <blockquote class="citation"> <p> Are you using native typeof or typeof emulation? </p> </blockquote> <p> I apologize if I am spamming you, but my answer hasn't been showing up in my view of the ticket, so I'm trying yet again. </p> <p> I'm using the default settings, which say in the output Window that native typeof is being used. Note also that this works in VS2010 but not in VS2008, so it is MSVC-version specific. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sun, 02 Jan 2011 00:42:39 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5025#comment:3 https://svn.boost.org/trac10/ticket/5025#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Thanks. I can confirm the problem with both native typeof and typeof emulation. BOOST_TYPEOF_NESTED_TYPEDEF doesn't help either. I've reduced it to </p> <pre class="wiki">template&lt;typename T&gt; int typeof_register_type(const T&amp;); struct S { virtual void f() = 0; enum { _typeof_register_value=sizeof(::typeof_register_type(&amp;S::f)) }; }; </pre><p> I'm afraid that there is no way for Boost.Typeof to avoid this problematic construct. </p> Ticket