Refactor places which perform contextual implicit conversions to go through a
common function. The C++1y contextual implicit conversion rules themselves are
not yet implemented, however.

This also fixes a subtle bug where template instantiation context notes were
dropped for diagnostics coming from conversions for integral constant
expressions -- we were implicitly slicing a SemaDiagnosticBuilder into a
DiagnosticBuilder when producing these diagnostics, and losing their context
notes in the process.

llvm-svn: 182406
diff --git a/clang/test/SemaCXX/conversion-delete-expr.cpp b/clang/test/SemaCXX/conversion-delete-expr.cpp
index 0f298a8..a1ddeb2 100644
--- a/clang/test/SemaCXX/conversion-delete-expr.cpp
+++ b/clang/test/SemaCXX/conversion-delete-expr.cpp
@@ -2,11 +2,11 @@
 
 // Test1
 struct B {
-  operator char *(); // expected-note {{candidate function}}
+  operator char *(); // expected-note {{conversion to pointer type}}
 };
 
 struct D : B {
-  operator int *(); // expected-note {{candidate function}}
+  operator int *(); // expected-note {{conversion to pointer type}}
 };
 
 void f (D d)
@@ -30,11 +30,11 @@
 
 // Test3
 struct B2 {
-  operator const int *();	// expected-note {{candidate function}}
+  operator const int *(); // expected-note {{conversion to pointer type}}
 };
 
 struct D2 : B2 {
-  operator int *();	// expected-note {{candidate function}}
+  operator int *(); // expected-note {{conversion to pointer type}}
 };
 
 void f2 (D2 d)
@@ -44,11 +44,11 @@
 
 // Test4
 struct B3 {
-  operator const int *();	// expected-note {{candidate function}}
+  operator const int *(); // expected-note {{conversion to pointer type}}
 };
 
 struct A3 {
-  operator const int *();	// expected-note {{candidate function}}
+  operator const int *(); // expected-note {{conversion to pointer type}}
 };
 
 struct D3 : A3, B3 {
@@ -78,7 +78,7 @@
 
 // Test7
 struct Base {
-   operator int*();	
+   operator int*();
 };
 
 struct Derived : Base {
@@ -87,9 +87,9 @@
 };
 
 void foo6(const Derived cd, Derived d) {
-	// overload resolution selects Derived::operator int*() const;
-	delete cd;
-	delete d;	
+  // overload resolution selects Derived::operator int*() const;
+  delete cd;
+  delete d;
 }
 
 // Test8
@@ -104,6 +104,6 @@
 
 void foo7 (DD d)
 {
-        // OK. In selecting a conversion to pointer function, template convesions are skipped.
-	delete d;
+  // OK. In selecting a conversion to pointer function, template convesions are skipped.
+  delete d;
 }