ART: Fix old warnings

Fix Wundefined-var-template warnings.

Partially reverts commit df53be273509dd43725870fb20a2c7d71f7fbfd3.

Bug: 28149048
Bug: 29823425
Test: m
Test: m test-art-host
Change-Id: Ib077312558f9e2f784859861c000fbac8375b3f5
diff --git a/build/Android.bp b/build/Android.bp
index c54f436..cf6ff5f 100644
--- a/build/Android.bp
+++ b/build/Android.bp
@@ -59,10 +59,8 @@
         "-Wunreachable-code-break",
         "-Wunreachable-code-return",
 
-        // Bug: http://b/29823425  Disable -Wconstant-conversion and
-        // -Wundefined-var-template for Clang update to r271374
+        // Bug: http://b/29823425  Disable -Wconstant-conversion for Clang update to r271374
         "-Wno-constant-conversion",
-        "-Wno-undefined-var-template",
 
         // Enable thread annotations for std::mutex, etc.
         "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h
index 7287a92..99565c6 100644
--- a/runtime/mirror/array.h
+++ b/runtime/mirror/array.h
@@ -188,6 +188,16 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(PrimitiveArray);
 };
 
+// Declare the different primitive arrays. Instantiations will be in array.cc.
+extern template class PrimitiveArray<uint8_t>;   // BooleanArray
+extern template class PrimitiveArray<int8_t>;    // ByteArray
+extern template class PrimitiveArray<uint16_t>;  // CharArray
+extern template class PrimitiveArray<double>;    // DoubleArray
+extern template class PrimitiveArray<float>;     // FloatArray
+extern template class PrimitiveArray<int32_t>;   // IntArray
+extern template class PrimitiveArray<int64_t>;   // LongArray
+extern template class PrimitiveArray<int16_t>;   // ShortArray
+
 // Either an IntArray or a LongArray.
 class PointerArray : public Array {
  public:
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 06ee3d3..e4b5320 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -1143,9 +1143,7 @@
 dex::TypeIndex Class::FindTypeIndexInOtherDexFile(const DexFile& dex_file) {
   std::string temp;
   const DexFile::TypeId* type_id = dex_file.FindTypeId(GetDescriptor(&temp));
-  return (type_id == nullptr)
-      ? dex::TypeIndex(DexFile::kDexNoIndex)
-      : dex_file.GetIndexForTypeId(*type_id);
+  return (type_id == nullptr) ? dex::TypeIndex() : dex_file.GetIndexForTypeId(*type_id);
 }
 
 template <PointerSize kPointerSize, bool kTransactionActive>