void setAsIdentityConversion();
bool isIdentityConversion() const {
- return First == ICK_Identity && Second == ICK_Identity &&
- Third == ICK_Identity;
+ return Second == ICK_Identity && Third == ICK_Identity;
}
ImplicitConversionRank getRank() const;
// the identity conversion sequence is considered to be a subsequence of
// any non-identity conversion sequence
- if (SCS1.ReferenceBinding == SCS2.ReferenceBinding) {
- if (SCS1.isIdentityConversion() && !SCS2.isIdentityConversion())
- return ImplicitConversionSequence::Better;
- else if (!SCS1.isIdentityConversion() && SCS2.isIdentityConversion())
- return ImplicitConversionSequence::Worse;
- }
+ if (SCS1.isIdentityConversion() && !SCS2.isIdentityConversion())
+ return ImplicitConversionSequence::Better;
+ else if (!SCS1.isIdentityConversion() && SCS2.isIdentityConversion())
+ return ImplicitConversionSequence::Worse;
if (SCS1.Second != SCS2.Second) {
if (SCS1.Second == ICK_Identity)
g(W());
}
}
+
+namespace rdar9173984 {
+ template <typename T, unsigned long N> int &f(const T (&)[N]);
+ template <typename T> float &f(const T *);
+
+ void test() {
+ int arr[2] = {0, 0};
+ int *arrp = arr;
+ int &ir = f(arr);
+ float &fr = f(arrp);
+ }
+}
+
+namespace PR9507 {
+ void f(int * const&); // expected-note{{candidate function}}
+ void f(int const(&)[1]); // expected-note{{candidate function}}
+
+ int main() {
+ int n[1];
+ f(n); // expected-error{{call to 'f' is ambiguous}}
+ }
+}