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

Inheriting an explicit constuctor

Eugene_S_1
Beginner
356 Views

Intel C++ compiler (Version 16.0.3.207 Build 20160415) seems to drop the explicit specifier when the constructor of the base class is inherited with using.

struct B
{
    explicit B(int) { }
};

struct D : B
{
    using B::B;
};

B b = 1; // Not OK, fine
D d = 1; // Not OK with Microsoft C++ and GCC, but OK with Intel C++
0 Kudos
1 Reply
Yuan_C_Intel
Employee
356 Views

Hi, Eugene

Thank you for reporting this issue.

I have reproduce the issue you reported and entered into our problem-tracking system. We will try to resolve this issue as soon as we can. However, please be advised that this issue may have to be targeted to for the next major release. I will let you know when I have an update on this issue.

Thank you.

0 Kudos
Reply