PR c++/66921
* decl.c (cp_complete_array_type): Allow an initializer that
already has array type.
From-SVN: r231914
2015-12-22 Jason Merrill <jason@redhat.com>
+ PR c++/66921
+ * decl.c (cp_complete_array_type): Allow an initializer that
+ already has array type.
+
PR c++/67257
* parser.c (cp_parser_single_declaration): Reject a class template
that also declares a variable.
/* Don't get confused by a CONSTRUCTOR for some other type. */
if (initial_value && TREE_CODE (initial_value) == CONSTRUCTOR
- && !BRACE_ENCLOSED_INITIALIZER_P (initial_value))
+ && !BRACE_ENCLOSED_INITIALIZER_P (initial_value)
+ && TREE_CODE (TREE_TYPE (initial_value)) != ARRAY_TYPE)
return 1;
if (initial_value)
--- /dev/null
+// PR c++/66921
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+struct Holder {
+ constexpr static const int array[] = { 1, 2, 3 };
+ enum {F = array[0]};
+};
+class HI: public Holder<int> {};