https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85251
Bug ID: 85251
Summary: Using declaration for base class constructor looses
explicit.
Product: gcc
Version: 6.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: maxim.yegorushkin at gmail dot com
Target Milestone: ---
Example:
#include <cstdio>
struct A {
template<class... Args>
A(Args&&... args) { std::printf("%s\n", __PRETTY_FUNCTION__); }
explicit A(int) { std::printf("%s\n", __PRETTY_FUNCTION__); }
};
struct B : A { using A::A; };
int main(int ac, char**) {
A a = ac;
B b = ac;
}
Outputs:
A::A(Args&& ...) [with Args = {int&}]
A::A(int)
Expected output (clang++-3.9.0 output):
A::A(Args&& ...) [with Args = {int&}]
A::A(Args&& ...) [with Args = {int&}]