- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After the upgrade of premier.intel.com I can't login anymore, so posting here a small reproducer for a bug in icpc 14.0.0, see below.
[build@fc19jslave09 ~]$ cat t.cpp
#include <type_traits>
class T_base;
template<typename T,
typename = typename std::enable_if<
std::is_base_of<T_base, T>::value>::type, typename ...Args>
void f(T const&);
template<typename T,
typename = typename std::enable_if<
std::is_base_of<T_base, T>::value>::type, typename ...Args>
inline void f(T const&)
{
}
[build@fc19jslave09 ~]$ icpc -std=c++0x -c t.cpp
t.cpp(9): error: redefinition of default argument
typename = typename std::enable_if<
^
compilation aborted for t.cpp (code 2)
[build@fc19jslave09 ~]$ g++ -std=c++11 -c t.cpp
[build@fc19jslave09 ~]$ g++ --version
g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[build@fc19jslave09 ~]$ icpc --version
icpc (ICC) 14.0.0 20130728
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the exact output is above, see that this is the Intel C++ 14 compiler on Linux, installed it on a Fedora 19 box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have an empty #include it appears to be a simple failure to find a corresponding source file, aside from the questionable error report.
I don't know about putting -std option after the source file.
For me, it gives a more explicit message:
test.cpp(1): catastrophic error: expected a file name
#include
^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks the Developer Forum zapped some text at some point, in the textual email related to the update type_traits was listed as filename after the included file. Independent of this, this looks a complete different issue, if it can't find type_traits it looks an installation problem, not related to mine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Oups bad copy past,
HEre the minimal code
#include <type_traits>
int main()
{
}
the result
icpc -o t test.cpp -std=c++11
test.cpp(1): catastrophic error: cannot open source file "type_traits"
#include <type_traits>
^
compilation aborted for test.cpp (code 4)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Olivier, this looks really a setup problem, the compiler should be able to find this file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding the default argument redefinition error:
This is a valid error. You are not allowed by the C++ standard to redefine a default argument, (even to the same value). But we need to allow it since GNU allows it so we are tracking this in our bug database as a GNU compatibility as DPD 200385046. Thanks for reporting it. In the meantime you can/should fix your code by removing the duplicate default argument on the definition.
Some relevant discussions are:
http://stackoverflow.com/questions/2842928/default-value-of-function-parameter
http://stackoverflow.com/questions/4989483/where-to-put-default-parameter-value-in-c
http://stackoverflow.com/questions/6210450/the-compiler-is-complaining-about-my-default-parameters
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding the lack of the header file <type_traits>, this was added by C++11 so older versions of GNU will not have it (I think it got added in GNU version 4.3). So do a g++ -v to see what version of the GNU header files you using. Intel does not provide its own set of headers/libraries, it just uses whatever is already installed on your system.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, this is a GCC specific feature which also has been confirmed as GCC bug, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50370

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