diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-01-27 03:51:04 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-01-27 03:51:04 +0000 |
| commit | 3edc4d5ec3fdce08e5c46db32f5f793a1cf7a3f4 (patch) | |
| tree | 0564413897d9730ed1a9d8ba7f749214ed4821ca /clang/lib/Sema/SemaOverload.h | |
| parent | 86121519cadca11d8865ec713e248a8740657618 (diff) | |
| download | bcm5719-llvm-3edc4d5ec3fdce08e5c46db32f5f793a1cf7a3f4.tar.gz bcm5719-llvm-3edc4d5ec3fdce08e5c46db32f5f793a1cf7a3f4.zip | |
Fix a major oversight in the comparison of standard conversion
sequences, where we would occasionally determine (incorrectly) that
one standard conversion sequence was a proper subset of another when,
in fact, they contained completely incomparable conversions.
This change records the types in each step within a standard
conversion sequence, so that we can check the specific comparison
types to determine when one sequence is a proper subset of the
other. Fixes this testcase (thanks, Anders!), which was distilled from
PR6095 (also thanks to Anders).
llvm-svn: 94660
Diffstat (limited to 'clang/lib/Sema/SemaOverload.h')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaOverload.h b/clang/lib/Sema/SemaOverload.h index 06617d3afa9..66ed2259bd2 100644 --- a/clang/lib/Sema/SemaOverload.h +++ b/clang/lib/Sema/SemaOverload.h @@ -139,9 +139,10 @@ namespace clang { /// QualType. void *FromTypePtr; - /// ToType - The type that this conversion is converting to. This - /// is an opaque pointer that can be translated into a QualType. - void *ToTypePtr; + /// ToType - The types that this conversion is converting to in + /// each step. This is an opaque pointer that can be translated + /// into a QualType. + void *ToTypePtrs[3]; /// CopyConstructor - The copy constructor that is used to perform /// this conversion, when the conversion is actually just the @@ -151,12 +152,22 @@ namespace clang { CXXConstructorDecl *CopyConstructor; void setFromType(QualType T) { FromTypePtr = T.getAsOpaquePtr(); } - void setToType(QualType T) { ToTypePtr = T.getAsOpaquePtr(); } + void setToType(unsigned Idx, QualType T) { + assert(Idx < 3 && "To type index is out of range"); + ToTypePtrs[Idx] = T.getAsOpaquePtr(); + } + void setAllToTypes(QualType T) { + ToTypePtrs[0] = T.getAsOpaquePtr(); + ToTypePtrs[1] = ToTypePtrs[0]; + ToTypePtrs[2] = ToTypePtrs[0]; + } + QualType getFromType() const { return QualType::getFromOpaquePtr(FromTypePtr); } - QualType getToType() const { - return QualType::getFromOpaquePtr(ToTypePtr); + QualType getToType(unsigned Idx) const { + assert(Idx < 3 && "To type index is out of range"); + return QualType::getFromOpaquePtr(ToTypePtrs[Idx]); } void setAsIdentityConversion(); |

