Community
cancel
Showing results for 
Search instead for 
Did you mean: 
John_Boltley
Beginner
156 Views

internal error: assertion failed: lower_constant: bad kind (shared/cfe/edgcpfe/lower_il.c, line 5315)

[cpp]

 % cat test.ii
extern "C" typedef
bool (*IsAcceptableThis) (const int &v);
typedef bool (*NativeImpl) (int *, int);
template < IsAcceptableThis, NativeImpl > void CallNonGenericMethod ();
typedef int (*JSNative) (int *, unsigned, int *);
typedef struct
{
    JSNative op;
}
JSNativeWrapper;
struct A
{
    JSNativeWrapper a;
};
struct B
{
};
template < typename NativeType > class C:B
{
public:
    NativeType ThisType;
    typedef C ThisTypeArray;
    static bool IsThisClass (const int &v);
    static bool fun_subarray_impl (int *, int);
    static int fun_subarray (int *, unsigned, int *)
    {
        CallNonGenericMethod < ThisTypeArray::IsThisClass,
                             ThisTypeArray::fun_subarray_impl > ();
        return 0;
    }
};
class D:public C < int >
{
};
A a[] = { D::fun_subarray };

 % icpc test.ii
test.ii(4): internal error: assertion failed: lower_constant: bad kind (shared/cfe/edgcpfe/lower_il.c, line 5315)

  template < IsAcceptableThis, NativeImpl > void CallNonGenericMethod ();
                                                 ^

compilation aborted for test.ii (code 4)

 % icpc -v
icpc version 13.0.0 (gcc version 4.7.0 compatibility)

[/cpp]

0 Kudos
1 Reply
Judith_W_Intel
Employee
156 Views

Thank you for reporting this and providing a small example. I have entered this in our bug tracking database as DPD200236114 and will try to fix it as soon as possible. One possible workaround is to make the static member functions IsThisClass and fun_subarray_impl global functions instead (of course this might require allowing greater access on some of your member data). Sorry for the inconvenience. Judy
Reply