Index: lib/Sema/SemaTemplateInstantiateDecl.cpp =================================================================== --- lib/Sema/SemaTemplateInstantiateDecl.cpp +++ lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -3858,11 +3858,12 @@ // Delay instantiation of the initializer for variable templates or inline // static data members until a definition of the variable is needed. We need - // it right away if the type contains 'auto'. + // it right away if the type contains 'auto' or is an IncompleteArrayType. if ((!isa(NewVar) && !InstantiatingVarTemplate && !(OldVar->isInline() && OldVar->isThisDeclarationADefinition())) || - NewVar->getType()->isUndeducedType()) + NewVar->getType()->isUndeducedType() || + NewVar->getType()->isIncompleteArrayType()) InstantiateVariableInitializer(NewVar, OldVar, TemplateArgs); // Diagnose unused local variables with dependent types, where the diagnostic Index: test/CXX/temp/temp.spec/temp.inst/p1.cpp =================================================================== --- test/CXX/temp/temp.spec/temp.inst/p1.cpp +++ test/CXX/temp/temp.spec/temp.inst/p1.cpp @@ -109,5 +109,16 @@ int test2 = g(); // expected-note {{here}} } +namespace PR28385 { +template struct X {}; + +template struct Y { + static constexpr int s_v[] = {0}; + X<*s_v> x; +}; + +template struct Y; +} + // FIXME: //- - member anonymous unions