@@ -824,9 +824,8 @@ build_cplus_array_type (tree elt_type, tree index_type)
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
- bool dependent = (processing_template_decl
- && (dependent_type_p (elt_type)
- || (index_type && dependent_type_p (index_type))));
+ bool dependent = (uses_template_parms (elt_type)
+ || (index_type && uses_template_parms (index_type)));
if (elt_type != TYPE_MAIN_VARIANT (elt_type))
/* Start with an array of the TYPE_MAIN_VARIANT. */
new file mode 100644
@@ -0,0 +1,19 @@
+// PR c++/62212
+// { dg-do assemble }
+
+typedef int my_int;
+
+template<typename T>
+struct X {
+ enum {value = 1};
+};
+
+template<typename T>
+void f(const my_int(&)[X<T>::value]);
+
+int main() {
+ const my_int a[1] = {};
+ f<void>(a);
+}
+
+// { dg-final { scan-assembler "_Z1fIvEvRAsr1XIT_E5value_Ki" } }