From 2fe9883a961dfa872b0a20e8b56e7bf65fc98b6f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 3 Nov 2008 19:09:14 +0000 Subject: Standard conversion sequences now have a CopyConstructor field, to cope with the case where a user-defined conversion is actually a copy construction, and therefore can be compared against other standard conversion sequences. While I called this a hack before, now I'm convinced that it's the right way to go. Compare overloads based on derived-to-base conversions that invoke copy constructors. Suppress user-defined conversions when attempting to call a user-defined conversion. llvm-svn: 58629 --- clang/lib/Sema/SemaOverload.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/Sema/SemaOverload.h') diff --git a/clang/lib/Sema/SemaOverload.h b/clang/lib/Sema/SemaOverload.h index 2fd6b1fb3e5..af3d1b407eb 100644 --- a/clang/lib/Sema/SemaOverload.h +++ b/clang/lib/Sema/SemaOverload.h @@ -18,6 +18,7 @@ #include "llvm/ADT/SmallVector.h" namespace clang { + class CXXConstructorDecl; class FunctionDecl; /// ImplicitConversionKind - The kind of implicit conversion used to @@ -114,6 +115,13 @@ namespace clang { /// is an opaque pointer that can be translated into a QualType. void *ToTypePtr; + /// CopyConstructor - The copy constructor that is used to perform + /// this conversion, when the conversion is actually just the + /// initialization of an object via copy constructor. Such + /// conversions are either identity conversions or derived-to-base + /// conversions. + CXXConstructorDecl *CopyConstructor; + void setAsIdentityConversion(); ImplicitConversionRank getRank() const; bool isPointerConversionToBool() const; -- cgit v1.2.3