- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code compiles fine under clang and gcc but fails for icc (v14.0.2):
namespace traits_tests {
template<typename> struct sfinae_true : true_type {};
template<typename T> static auto value_type(int) -> sfinae_true<typename T::value_type>;
template<typename T> static auto value_type(void*) -> false_type;
}
template<typename C>
struct has_value_type
: decltype(traits_tests::value_type<C>(0)) {};
with the error message
inc/traits.h(258): error: expected an identifier
: decltype(traits_tests::value_type<C>(0)) {};
^
.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Walter,
Could you please post us the complete test code to reproduce the issue.
Reddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this with a 14.0 compiler from 1/21/2014 but not 04/18/2014. So it should be fixed in version 14.0.3.
Please upgrade and let me know if it is still a problem for you.
thanks
Judy
sptxl15-214> cat t.cpp
struct true_type {};
struct false_type {};
namespace traits_tests {
template<typename> struct sfinae_true : true_type {};
template<typename T> static auto value_type(int) -> sfinae_true<typename T::value_type>;
template<typename T> static auto value_type(void*) -> false_type;
}
template<typename C>
struct has_value_type
: decltype(traits_tests::value_type<C>(0)) {};
sptxl15-215> /home/cmplr/archive/SWF/deploy_14_0/x86linux/20140121_010000/build/linux_debug/bin/ia32/icpc -c -std=c++11 t.cpp
t.cpp(14): error: expected an identifier
: decltype(traits_tests::value_type<C>(0)) {};
^
compilation aborted for t.cpp (code 2)
sptxl15-216> /home/cmplr/archive/SWF/deploy_14_0/x86linux/20140418_000000/build/linux_debug/bin/ia32/icpc -c -std=c++11 t.cpp
sptxl15-217>
Judy

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