https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79195
Bug ID: 79195
Summary: make_array should not ask for common_type when the
type is explicitly specified
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: rs2740 at gmail dot com
Target Milestone: ---
This does not compile:
#include <experimental/array>
struct A {};
struct B : A {};
struct C : A {};
auto arr = std::experimental::make_array<A>(B{}, C{});
because make_array's return type computes
conditional_t<is_void_v<_Dest>, common_type_t<_Types...>, _Dest>
which instantiates common_type_t<B,C> and results in a substitution failure.
There shouldn't be a need to instantiate it when the desired element type is
explicitly specified.