Opened 12 years ago

Closed 12 years ago

#5025 closed Bugs (wontfix)

BOOST_TYPEOF VS2008 Internal Compiler Error

Reported by: Mike Spertus <mike_spertus@…> Owned by: Peder Holt
Milestone: To Be Determined Component: typeof
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

Visual Studio 2008 crashes (C1001: An internal error has occurred in the compiler) when compiling the following code:

#include <boost/typeof/typeof.hpp>

struct S {

virtual void f() = 0; typedef BOOST_TYPEOF(&S::f) T;

};

Change History (3)

comment:1 by Steven Watanabe, 12 years ago

Component: Nonetypeof
Owner: set to Peder Holt

Are you using native typeof or typeof emulation?

in reply to:  1 comment:2 by Mike Spertus <mike_spertus@…>, 12 years ago

Replying to steven_watanabe:

Are you using native typeof or typeof emulation?

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.

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.

comment:3 by Steven Watanabe, 12 years ago

Resolution: wontfix
Status: newclosed

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

template<typename T>
int typeof_register_type(const T&);

struct S {
    virtual void f() = 0;
    enum {
        _typeof_register_value=sizeof(::typeof_register_type(&S::f))
    };
};

I'm afraid that there is no way for Boost.Typeof to avoid this problematic construct.

Note: See TracTickets for help on using tickets.