]> granicus.if.org Git - clang/commitdiff
[SemaDeclCXX] Allow inheriting constructor declaration to specify a cv-qualified...
authorTan S. B <cpplearner@outlook.com>
Sat, 17 Aug 2019 20:57:52 +0000 (20:57 +0000)
committerTan S. B <cpplearner@outlook.com>
Sat, 17 Aug 2019 20:57:52 +0000 (20:57 +0000)
Differential Revision: https://reviews.llvm.org/D47419

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369196 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp
test/CXX/special/class.inhctor/elsewhere.cpp

index 2442986eff30b16e450733c0c58319d9fabc134e..09c29851dda1484c9472fd80a0a64fa352947ff0 100644 (file)
@@ -9997,7 +9997,8 @@ static CXXBaseSpecifier *findDirectBaseWithType(CXXRecordDecl *Derived,
                                                 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 c042834b2147b8a3adb640314b884947217b7974..f86f4b86faa7d7d9929bad06589e17c194163017 100644 (file)
@@ -62,3 +62,4 @@ struct G : T {
   G(int &) : G(0) {}
 };
 G<B1> g(123);
+G<const B1> g2(123);