@@ -967,7 +967,9 @@ can_init_array_with_p (tree type, tree init)
return true;
}
- return false;
+ permerror (input_location, "array must be initialized "
+ "with a brace-enclosed initializer");
+ return true;
}
/* Initialize MEMBER, a FIELD_DECL, with INIT, a TREE_LIST of
@@ -1,5 +1,6 @@
// PR c++/116634
// { dg-do compile { target c++11 } }
+// { dg-additional-options -fpermissive }
namespace std {
using size_t = decltype(sizeof(42));
@@ -20,7 +21,7 @@ private:
template<int N>
struct Any final {
constexpr
- Any(ConstString (&&_vec)[N]) noexcept: vec(_vec){} // { dg-error "array" }
+ Any(ConstString (&&_vec)[N]) noexcept: vec(_vec){} // { dg-warning "array" }
ConstString vec[N];
};
@@ -4,7 +4,7 @@
struct string {} a[1];
struct pair {
string s[1];
- pair() : s(a) {} // { dg-error "invalid initializer for array member" }
+ pair() : s(a) {} // { dg-error "array must be initialized" }
};
struct S {
@@ -7,7 +7,7 @@ struct I {
struct O {
I a[2];
static I const data[2];
- O() : a(data){} // { dg-error "invalid initializer for array member" }
+ O() : a(data){} // { dg-error "array must be initialized" }
};
I const O::data[2] = {true, false};
@@ -16,7 +16,7 @@ typedef UserType Array[my_size];
class Foo
{
public:
- Foo(Array& m) : m_(m) {}; // { dg-error "invalid initializer for array member" }
+ Foo(Array& m) : m_(m) {}; // { dg-error "array must be initialized" }
private:
Array m_;
};