- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
icpc (ICC) 19.0.0.117 20180804 This works in g++ but not icpc with the same runtime library includes. icpc -std=c++17 -c /tmp/t.cpp -o /tmp/t.o #include <variant> void foo(); void foo() { std::variant<std::monostate, int> bar; } Gives: /tmp/t.cpp(7): error: the default constructor of "std::variant<std::monostate, int>" cannot be referenced -- it is a deleted function std::variant<std::monostate, int> bar; According to cppreference, the default constructor "Constructs a variant holding the value-initialized value of the first alternative (index() is zero). This constructor is constexpr if and only if the value initialization of the alternative type T_0 would satisfy the requirements for a constexpr function. This overload only participates in overload resolution if std::is_default_constructible_v<T_0> is true."
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let me look into it and will get back to you.
Thanks,
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have reported this to our Developer. Case number is CMPLRLIBS-2742
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had a workaround, but now I get an internal compiler error in Update 1 (2019.1.144):
#include <variant>
int main()
{
using var_t = std::variant<std::monostate, int>;
struct Workaround : var_t
{
Workaround() : var_t(std::in_place_type<std::monostate>)
{}
};
Workaround myvar;
return 0;
}
/opt/intel/compilers_and_libraries_2019.1.144/linux/bin/intel64/icpc -g -std=gnu++17 -o CMakeFiles/tmpproject.dir/__/main.cpp.o -c /home/jharris/tmp/tmpproject/main.cpp
/home/jharris/tmp/tmpproject/main.cpp(10): internal error: assertion failed at: "shared/cfe/edgcpfe/class_decl.c", line 3662
{}
^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting it. This seems to be a known issue. We have a bug number cmplril0-30500 to track it.
Viet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Was this bug ever fixed? We were just hit by it, and want to know what's the earliest version with a fix.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page