Enable MSVS warning 4512.

Fix up the missing DISALLOW_COPY_AND_ASSIGN macros and various small
problems preventing us from turning on this warning. This should
ensure we more often use the DISALLOW macro going forward.

Change-Id: I2e1a9d23a31a51279a577fad8dffb8c1530e2ee8
Reviewed-on: https://chromium-review.googlesource.com/251100
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cooper Partin <coopp@microsoft.com>
Tested-by: Cooper Partin <coopp@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index a368d29..ad87013 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -106,18 +106,21 @@
 struct AttributeSorter
 {
     AttributeSorter(const ProgramImpl::SemanticIndexArray &semanticIndices)
-        : originalIndices(semanticIndices)
+        : originalIndices(&semanticIndices)
     {
     }
 
     bool operator()(int a, int b)
     {
-        if (originalIndices[a] == -1) return false;
-        if (originalIndices[b] == -1) return true;
-        return (originalIndices[a] < originalIndices[b]);
+        int indexA = (*originalIndices)[a];
+        int indexB = (*originalIndices)[b];
+
+        if (indexA == -1) return false;
+        if (indexB == -1) return true;
+        return (indexA < indexB);
     }
 
-    const ProgramImpl::SemanticIndexArray &originalIndices;
+    const ProgramImpl::SemanticIndexArray *originalIndices;
 };
 
 }