If the element type of an initializer list has a destructor, make sure we check it. Fixes PR12178.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152048 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
index 775060b..81ce559 100644
--- a/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
+++ b/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
@@ -232,3 +232,21 @@
   destroyme2 dm2;
   // CHECK: call void @_ZN10destroyme2D1Ev
 }
+
+namespace PR12178 {
+  struct string {
+    string(int);
+    ~string();
+  };
+
+  struct pair {
+    string a;
+    int b;
+  };
+
+  struct map {
+    map(std::initializer_list<pair>);
+  };
+
+  map m{ {1, 2}, {3, 4} };
+}