Index: lib/Sema/SemaDeclCXX.cpp =================================================================== --- lib/Sema/SemaDeclCXX.cpp +++ lib/Sema/SemaDeclCXX.cpp @@ -9686,7 +9686,8 @@ QualType DesiredBase, bool &AnyDependentBases) { // Check whether the named type is a direct base class. - CanQualType CanonicalDesiredBase = DesiredBase->getCanonicalTypeUnqualified(); + CanQualType CanonicalDesiredBase = DesiredBase->getCanonicalTypeUnqualified() + .getUnqualifiedType(); for (auto &Base : Derived->bases()) { CanQualType BaseType = Base.getType()->getCanonicalTypeUnqualified(); if (CanonicalDesiredBase == BaseType) Index: test/CXX/special/class.inhctor/elsewhere.cpp =================================================================== --- test/CXX/special/class.inhctor/elsewhere.cpp +++ test/CXX/special/class.inhctor/elsewhere.cpp @@ -62,3 +62,4 @@ G(int &) : G(0) {} }; G g(123); +G g2(123);