r369196 - [SemaDeclCXX] Allow inheriting constructor declaration to specify a cv-qualified type

Tan S. B. via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 17 13:57:52 PDT 2019


Author: cpplearner
Date: Sat Aug 17 13:57:52 2019
New Revision: 369196

URL: http://llvm.org/viewvc/llvm-project?rev=369196&view=rev
Log:
[SemaDeclCXX] Allow inheriting constructor declaration to specify a cv-qualified type

Differential Revision: https://reviews.llvm.org/D47419

Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=369196&r1=369195&r2=369196&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Aug 17 13:57:52 2019
@@ -9997,7 +9997,8 @@ static CXXBaseSpecifier *findDirectBaseW
                                                 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)

Modified: cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp?rev=369196&r1=369195&r2=369196&view=diff
==============================================================================
--- cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp (original)
+++ cfe/trunk/test/CXX/special/class.inhctor/elsewhere.cpp Sat Aug 17 13:57:52 2019
@@ -62,3 +62,4 @@ struct G : T {
   G(int &) : G(0) {}
 };
 G<B1> g(123);
+G<const B1> g2(123);




More information about the cfe-commits mailing list