From 786ab2119f288bd00e0c6583ecf46e90ecfa6a5c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 29 Oct 2008 02:00:59 +0000 Subject: Tweak Sema::CheckReferenceInit so that it (optionally) computes an ImplicitConversionSequence and, when doing so, following the specific rules of [over.best.ics]. The computation of the implicit conversion sequences implements C++ [over.ics.ref], but we do not (yet) have ranking for implicit conversion sequences that use reference binding. llvm-svn: 58357 --- clang/lib/Sema/SemaOverload.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'clang/lib/Sema/SemaOverload.h') diff --git a/clang/lib/Sema/SemaOverload.h b/clang/lib/Sema/SemaOverload.h index 27190f6e996..558718c0d94 100644 --- a/clang/lib/Sema/SemaOverload.h +++ b/clang/lib/Sema/SemaOverload.h @@ -38,6 +38,7 @@ namespace clang { ICK_Pointer_Conversion, ///< Pointer conversions (C++ 4.10) ICK_Pointer_Member, ///< Pointer-to-member conversions (C++ 4.11) ICK_Boolean_Conversion, ///< Boolean conversions (C++ 4.12) + ICK_Derived_To_Base, ///< Derived-to-base (C++ [over.best.ics][) ICK_Num_Conversion_Kinds ///< The number of conversion kinds }; @@ -91,9 +92,9 @@ namespace clang { /// Third - The third conversion can be a qualification conversion. ImplicitConversionKind Third : 8; - /// Deprecated - Whether this is a deprecated conversion, such as - /// converting a string literal to a pointer to non-const - /// character data (C++ 4.2p2). + /// Deprecated - Whether this the deprecated conversion of a + /// string literal to a pointer to non-const character data + /// (C++ 4.2p2). bool Deprecated : 1; /// FromType - The type that this conversion is converting @@ -154,7 +155,17 @@ namespace clang { }; /// ConversionKind - The kind of implicit conversion sequence. - Kind ConversionKind; + /// As usual, we use "unsigned" here because VC++ makes enum bitfields + /// signed. + unsigned ConversionKind : 2; + + /// ReferenceBinding - True when this is a reference binding + /// (C++ [over.ics.ref]). + bool ReferenceBinding : 1; + + /// DirectBinding - True when this is a reference binding that is a + /// direct binding (C++ [dcl.init.ref]). + bool DirectBinding : 1; union { /// When ConversionKind == StandardConversion, provides the -- cgit v1.2.3