find out its type. For OpenMP user defined reductions, we need them
instantiated for reduction clauses which inline them by hand directly. */
if (undeduced_auto_decl (decl)
+ || (VAR_P (decl)
+ && VAR_HAD_UNKNOWN_BOUND (decl))
|| (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_OMP_DECLARE_REDUCTION_P (decl)))
maybe_instantiate_decl (decl);
return error_mark_node;
}
- /* To get the size of a static data member declared as an array of
- unknown bound, we need to instantiate it. */
- if (VAR_P (expr)
- && VAR_HAD_UNKNOWN_BOUND (expr)
- && DECL_TEMPLATE_INSTANTIATION (expr))
- instantiate_decl (expr, /*defer_ok*/true, /*expl_inst_mem*/false);
-
if (id_expression_or_member_access_p)
{
/* If e is an id-expression or a class member access (5.2.5
location_t e_loc = cp_expr_loc_or_loc (e, loc);
STRIP_ANY_LOCATION_WRAPPER (e);
- /* To get the size of a static data member declared as an array of
- unknown bound, we need to instantiate it. */
- if (VAR_P (e)
- && VAR_HAD_UNKNOWN_BOUND (e)
- && DECL_TEMPLATE_INSTANTIATION (e))
- instantiate_decl (e, /*defer_ok*/true, /*expl_inst_mem*/false);
-
if (TREE_CODE (e) == PARM_DECL
&& DECL_ARRAY_PARAMETER_P (e)
&& (complain & tf_warning))
--- /dev/null
+// PR c++/115358
+
+template<class T>
+struct A { static int STR[]; };
+
+template<class T>
+int A<T>::STR[] = {1,2,3};
+
+void f(int(&)[3]);
+
+template<class T>
+void g() {
+ f(A<int>::STR); // { dg-bogus "int []" }
+}