[Bug c++/82235] New: Copy ctor is not found for copying array of an object when it's marked explicit
gnu-9fbaow at upsuper dot org
gcc-bugzilla@gcc.gnu.org
Mon Sep 18 04:36:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82235
Bug ID: 82235
Summary: Copy ctor is not found for copying array of an object
when it's marked explicit
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gnu-9fbaow at upsuper dot org
Target Milestone: ---
See the following code:
struct Foo {
Foo() {}
explicit Foo(const Foo& aOther) {}
};
struct Bar {
Foo m[1];
};
void test() {
Bar a;
Bar b = a;
}
GCC fails to compile it and reports:
> error: no matching function for call to 'Foo::Foo(const Foo&)'
MSVC and Clang both work fine on this case.
Removing "explicit" in Foo works, but given that removing "[1]" in Bar also
works, "explicit" on copy ctor shouldn't affect anything here.
More information about the Gcc-bugs
mailing list