- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried compiling the following code with non-commercial icpc compiler:
[cpp]#include<iostream>
\
template<class T> struct test
{
static const bool value = std::is_convertible<T,double>::value;
};
\
template<class T> // <-- if these two lines are commented out the code compiles
using Request_double = typename std::enable_if<test<T>::value,void* >::type; // <--
\
//template<class T, Request_double<T> = nullptr >
template<class T, typename std::enable_if<test<T>::value,void*>::type = nullptr >
void func(T t)
{
std::cout << t << std::endl;
}
\
//template<class T, class... U, Request_double<T> = nullptr >
template<class T, class... U, typename std::enable_if<test<T>::value,void*>::type = nullptr >
void func(T t, U... u)
{
std::cout << t << " ";
func(u...);
}
\
int main()
{
double a = 2.0, b = 3.0, c = 4.0;
\
func(a,b,c);
\
return 0;
}[/cpp]
Compiling this gives me the error:
[plain]icpc -O3 -std=c++11 -o main main.cc
main.cc(30): internal error: assertion failed: missing default rescan info (shared/cfe/edgcpfe/exprutil.c, line 4284)
\
func(a,b,c);
^
\
compilation aborted for main.cc (code 4)[/plain]
This Code compiles fine on both GCC 4.7.3 and Clang 3.3. My question is if this is a bug or an unimplemented feature? and if so when it will be fixed/implemented? Commenting out the template alias "Request_double" also makes the code compile with icpc(?!).
The version of icpc I'm using is:
[plain]icpc --version
icpc (ICC) 14.0.0 20130728
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.[/plain]
and I'm running it on an Ubuntu 13.04 machine.
Thanks in advance
- Ian Godtliebsen
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Build good with compiler 14.0 update1
$ icpc -V
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.1.106 Build 20131008
Thanks,
QIAOMIN Q.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm now using:
$ icpc -V
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.1.106 Build 20131008
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
Still gives the same error:
$ icpc -O3 -std=c++11 -o main main.cc
main.cc(30): internal error: assertion failed: missing default rescan info (shared/cfe/edgcpfe/exprutil.c, line 4291)
func(a,b,c);
^
compilation aborted for main.cc (code 4)
- Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you much for your test case. I've reproduced the problem you reported, and have entered it to our problem-tracking database. I'll let you know when I have an update from development team.
Thank you. -- QIAOMIN.Q
Intel Developer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This problem has been fixed in the upcoming next update of Compiler 14.0 ,which has been enhanced to strictly compare template parameters to make sure they aren't using the same constants.
Best,
QIao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This problem has been fixed in the upcoming next update of Compiler 14.0 ,which has been enhanced to strictly compare template parameters to make sure they aren't using the same constants.
Best,
QIao

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page