Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

assertion failure in compiler?

Maarten_Hekkelman
389 Views

I'm running into a problem with update2 of the C++ compiler on Linux. I have code that looks like this, it uses boost/foreach.

typedef element* element_ptr;
typedef list element_set;

class foo { element_set find(const char*); }

foreach (element* e, foo->find("/xyz"))
{
}

When compiling this code I get:

src/M6Server.cpp(361) (col. 3): internal error: assertion failed at: "shared/cfe/edgglue/edg_eh_n.c", line 234

I can work around this error by using:

element_set es(foo->find("/xyz"));
foreach (element* e, es) { ... }

but that's not as elegant in my eyes.

Related to this, is there any news on when will the Intel compilers support the new range based for loop so I can drop using boost foreach?

Thansk,

-maarten hekkelman

0 Kudos
3 Replies
Judith_W_Intel
Employee
389 Views

I think you're going to have to fill in more of the missing pieces here.
I tried to recreate the problem (below) butdidn't see the assertion. Note that I changed foreach to BOOST_FOREACH because foreach didn't compile for me.


The easiest thing to do might be to createa preprocessed file (using -E or -P) and attach it...




sptxl8-167> cat t.cpp
#include
#include

using namespace boost;
using namespace boost::foreach;
using namespace std;

struct element {
~element() {;}
};

typedef element* element_ptr;
typedef list element_set;

struct F {
element_set find(const char*);
~F();
};

int main() {
F* foo = new F;
//foreach(element* e, foo->find("/xyz"))
BOOST_FOREACH(element* e, foo->find("/xyz") )
{
}
return 0;
}
sptxl8-168> icpc -I. -c t.cpp
sptxl8-169>

0 Kudos
Maarten_Hekkelman
389 Views

Dear Judith,

Thanks for your reply. It took some time, but I reduced the problem to the following code.

-maarten

#include

#define foreach BOOST_FOREACH

#include
#include

struct element;
typedef std::list element_set;

struct element
{
element_set find(const std::string& path) const;
};

element* e;

void handle_entry()
{
foreach (element* link, e->find("link"))
{
}
}

0 Kudos
Judith_W_Intel
Employee
389 Views

Thank you for the test case.

I can nowreproduce it. It lookslike this was already recentlyreported as DPD200180570 in our internal
bugs database. It was fixed internally on 4/10 but too late to make the 12.1 update that's already in progress.

The fixshould make the next 12.1 update (in June).

Sorry for the inconvenience. It looks like you already have a workaround so I won't bother to suggest one...

Anyway, thanks again...

Judy
0 Kudos
Reply