to be considering user-defined conversions in the first place.
Doug, please review; I'm not sure what we should be doing if we see a real
ambiguity in selecting a copy constructor when otherwise suppressing
user-defined conversions.
Fixes PR6014.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93365
91177308-0d34-0410-b5e6-
96231b3b80d8
ICS.setBad();
ICS.Bad.init(BadConversionSequence::suppressed_user, From, ToType);
}
- } else if (UserDefResult == OR_Ambiguous) {
+ } else if (UserDefResult == OR_Ambiguous && !SuppressUserConversions) {
ICS.setAmbiguous();
ICS.Ambiguous.setFromType(From->getType());
ICS.Ambiguous.setToType(ToType);
}
}
+// PR 6014
+namespace test2 {
+ struct QFixed {
+ QFixed(int i);
+ QFixed(long i);
+ };
+
+ bool operator==(const QFixed &f, int i);
+
+ class qrgb666 {
+ inline operator unsigned int () const;
+
+ inline bool operator==(const qrgb666 &v) const;
+ inline bool operator!=(const qrgb666 &v) const { return !(*this == v); }
+ };
+}