A conversion operator in a base class shouldn't hide another conversion operator
in the same class, even if they convert to the same type. Fixes PR12712.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156247 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index f19184c..e27d880 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -1050,8 +1050,10 @@
HiddenTypes = &HiddenTypesBuffer;
for (UnresolvedSetIterator I = Cs.begin(), E = Cs.end(); I != E; ++I) {
- bool Hidden =
- !HiddenTypesBuffer.insert(GetConversionType(Context, I.getDecl()));
+ CanQualType ConvType(GetConversionType(Context, I.getDecl()));
+ bool Hidden = ParentHiddenTypes.count(ConvType);
+ if (!Hidden)
+ HiddenTypesBuffer.insert(ConvType);
// If this conversion is hidden and we're in a virtual base,
// remember that it's hidden along some inheritance path.