Internal error with 3 lines

Internal error with 3 lines

The following short program yields an internal error if compiled with `icc -c'.

namespace { template void f() {} }
template void g(T) {}
void h() { g(f); }

I think it is correct C++. The following workaround does compile

namespace { template void f() {} }
template void g(T) {}
void h()
{
void (*fint)() = f;
g(fint);
}

--
Markus

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi, Markus:
I have duplicated your issue on both Windows and Linux. And also found two other work arounds.
1. remove "namespace"
2. add a name to "namespace" like "namespace me"

I'll report it to our engineering team. If you'd like to see any update to this issue, you can create an issue through our Premier Support.

Thanks very much for reporting this,
Jennifer

Yet another work around which also does not export f is

template static void f() {}

I tried to report the issue through Premier Support but there is an issue with my login which the QuAD Support is currently looking into.

--
Markus

Markus:
Please send me a note to my email directly. I'll create the issue for you in Premier Support with your email address, so you'll get an update when the bug gets fixed.

Thanks,
Jennifer

I can also reproduce it with older compilers, but it does appear to be fixed in the next version of the compiler. It would be a good idea to report this, as suggested previously.

-Jeff

Leave a Comment

Please sign in to add a comment. Not a member? Join today