Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7679 Discussions

Converting constructor issue with std::variant

Patnaik__Bvsk
Beginner
460 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
460 Views

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

Viet_H_Intel
Moderator
460 Views

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

Reply