Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Patnaik__Bvsk
Beginner
267 Views

Converting constructor issue with std::variant

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
267 Views

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

Viet_H_Intel
Moderator
267 Views

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

Reply