The following code compiles on clang 3.6 (C++14), but not on GCC 5.3 (C++14)
#include <array>
#include <utility>
struct super: std::array<int, 3> {
using base = std::array<int, 3>;
template <typename... Ts>
super(Ts&&... xs)
: base{std::forward<Ts>(xs)...} {
// nop
}
};
int main() {
super obj(1, 2, 3);
}
The error message produced is
/tmp/gcc-explorer-compiler116029-73-105rz4g/example.cpp: In instantiation of 'super::super(Ts&& ...) [with Ts = {int, int, int}]':
15 : required from here
9 : error: array must be initialized with a brace-enclosed initializer
: base{std::forward<Ts>(xs)...} {
^
9 : error: too many initializers for 'std::array<int, 3ul>'
I think I am initializing the base aggregate with a brace-enclosed initializer. No? What does the standard say about the syntax here?