Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7834 Discussions

Converting constructor issue with std::variant

Patnaik__Bvsk
Beginner
665 Views

Apologies if the issue was already reported but have a look at the following code snippet

#include <variant>

std::variant<int, char*> foo()
{
    return 0xD;
}

This should compile by choosing the converting constructor overload of the variant whose definition is

template< class T >
constexpr variant(T&& t) noexcept(...);

but it does not compile as can be seen here.

Compiler flags used: -std=c++17 -O3 -Wall -Werror

Compiler version: v19.0.1

0 Kudos
2 Replies
Viet_H_Intel
Moderator
665 Views

Thanks for report this issue. I've opened a case (CMPLRIL0-32507) internally.

0 Kudos
Viet_H_Intel
Moderator
665 Views

This will be fixed in the next release. I am going to close this thread. 

0 Kudos
Reply