===================================================================
@@ -20148,6 +20148,11 @@ instantiation_dependent_r (tree *tp, int *walk_sub
return NULL_TREE;
case VAR_DECL:
+ if (TREE_CODE (TREE_TYPE (*tp)) == ARRAY_TYPE
+ && !TYPE_DOMAIN (TREE_TYPE (*tp))
+ && DECL_INITIAL (*tp)
+ && type_dependent_expression_p (DECL_INITIAL (*tp)))
+ return *tp;
case CONST_DECL:
/* A constant with a dependent initializer is dependent. */
if (value_dependent_expression_p (*tp))
===================================================================
@@ -0,0 +1,20 @@
+// PR c++/53211
+// { dg-do compile { target c++11 } }
+
+template<typename A, typename B>
+ struct is_same { static const bool value = false; };
+
+template<typename A>
+ struct is_same<A, A> { static const bool value = true; };
+
+template<typename... Args>
+void func(Args... args)
+{
+ int arr[] = { args... };
+ static_assert (is_same<decltype(arr), int[sizeof...(Args)]>::value, "");
+}
+
+int main()
+{
+ func(1, 2, 3, 4);
+}