Re: [eigen] MSC compiler error: worth working around?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2010/4/16 Eamon Nerbonne <eamon.nerbonne@xxxxxxxxx>:
> Hi all,
> In the course of specializing some of my code to accept various eigen matrix
> types, I ran into an MSC bug.

There's 1 thing I dont understand: you're not the only one using MSC,
so why are you the first one to hit this problem? Hauke, do you know
about this?

>  Essentially, eigen's classes have lots of
> members in the style of "using Base::SomeEnumMember;".  Using those kind of
> "inherited" members as part of computations (not just unmodified usage) in
> template parameters in MSC triggers compiler bugs or an ICE (depending on
> the computation).  I submitted a simple test-case & bug report to microsoft,
> but that's been closed [WontFix].

At least they didn't sue you for patent infringement (USPTO 29043801
"Method for triggering a bug in MSC with enums").

> One workaround would be to replace "using Base::SomeEnumMember;" with
> "enum{ SomeEnumMember = ei_traits<typename
> Base::Derived>::SomeEnumMember};".

Often, the stuff is only present in a Base class, not in ei_traits. So
it would be:
 enum { SomeEnum = Base::SomeEnum };

> Leaving it out entirely works in MSC but
> not in GCC, unless I'm missing something.

Ah great! So on MSC we could replace using by just a comment opener "//"   ?

Maybe the bug could be worked around by introducing a macro
    EIGEN_IMPORT_ENUM(Enum, From)

>  Alternatively, wouldn't it be
> possible to remove these helpers entirely and just always refer to ei_traits
> for these things?

Again, the enums aren't always present in the traits. See in MatrixBase.h.
Also, a "using" statement is probably simpler, since it doesn't define
anything new, so if we have the choice, it's probably better.

Benoit

> --eamon@xxxxxxxxxxxx - Tel#:+31-6-15142163
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/