Index: cfe/trunk/lib/Sema/SemaDeclCXX.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp @@ -9997,7 +9997,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: cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp =================================================================== --- cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp +++ cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp @@ -62,3 +62,4 @@ G(int &) : G(0) {} }; G g(123); +G g2(123);