PointerUnion == PointerUnion does not do what I thought it did. Also, fix a thinko in a PointerUnion::get call.

llvm-svn: 90719
This commit is contained in:
Douglas Gregor
2009-12-06 21:27:58 +00:00
parent 30484700c5
commit 94bb5e8d75
4 changed files with 4 additions and 4 deletions

View File

@@ -222,7 +222,7 @@ public:
if (NamedDecl *ND = DeclOrIterator.dyn_cast<NamedDecl *>())
return reference(ND, SingleDeclIndex);
return *DeclOrIterator.get<DeclIndexPair*>();
return *DeclOrIterator.get<const DeclIndexPair*>();
}
pointer operator->() const {
@@ -230,13 +230,13 @@ public:
}
friend bool operator==(const iterator &X, const iterator &Y) {
return X.DeclOrIterator == Y.DeclOrIterator &&
return X.DeclOrIterator.getOpaqueValue()
== Y.DeclOrIterator.getOpaqueValue() &&
X.SingleDeclIndex == Y.SingleDeclIndex;
}
friend bool operator!=(const iterator &X, const iterator &Y) {
return X.DeclOrIterator != Y.DeclOrIterator ||
X.SingleDeclIndex != Y.SingleDeclIndex;
return !(X == Y);
}
};