Index: lib/Index/USRGeneration.cpp =================================================================== --- lib/Index/USRGeneration.cpp +++ lib/Index/USRGeneration.cpp @@ -816,6 +816,20 @@ T = VT->getElementType(); continue; } + if (const ArrayType *const AT = dyn_cast(T)) { + Out << "{"; + switch( AT->getSizeModifier() ) { + case ArrayType::Static : Out << "s"; break; + case ArrayType::Star : Out << "*"; break; + case ArrayType::Normal : Out << "n"; break; + } + if (const ConstantArrayType* const CAT = dyn_cast(T)) { + Out << CAT->getSize(); + } + Out << "}"; + T = AT->getElementType(); + continue; + } // Unhandled type. Out << ' '; Index: test/Index/USR/array-type.cpp =================================================================== --- /dev/null +++ test/Index/USR/array-type.cpp @@ -0,0 +1,8 @@ +// RUN: c-index-test core -print-source-symbols -- %s | grep "function(Gen,TS)/C++" | grep foo | cut -s -d "|" -f 4 | uniq | wc -l | grep 3 + +// Function template specializations differing in array type parameter should have unique USRs. + +template void foo(buffer); +template<> void foo(char[16]); +template<> void foo(char[32]); +template<> void foo(char[64]);