Internal error with 3 lines

Internal error with 3 lines

Portrait de mschoder

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 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Jennifer J. (Intel)

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

Portrait de mschoder

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

Portrait de Jennifer J. (Intel)

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

Portrait de Jeffrey Sullivan (Intel)

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

Connectez-vous pour laisser un commentaire.