diff options
author | Tan S. B. <cpplearner@outlook.com> | 2019-08-17 20:57:52 +0000 |
---|---|---|
committer | Tan S. B. <cpplearner@outlook.com> | 2019-08-17 20:57:52 +0000 |
commit | 8fd6aa5ed2d61d6ebba1185f59fe0e57fd218429 (patch) | |
tree | 2da4eca029adeb7e2365ba5531cd81613456fcd8 | |
parent | 032e1fdcd47ef98936c88aa30571c6a713179a46 (diff) | |
download | bcm5719-llvm-8fd6aa5ed2d61d6ebba1185f59fe0e57fd218429.tar.gz bcm5719-llvm-8fd6aa5ed2d61d6ebba1185f59fe0e57fd218429.zip |
[SemaDeclCXX] Allow inheriting constructor declaration to specify a cv-qualified type
Differential Revision: https://reviews.llvm.org/D47419
llvm-svn: 369196
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 3 | ||||
-rw-r--r-- | clang/test/CXX/special/class.inhctor/elsewhere.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 2442986eff3..09c29851dda 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -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) diff --git a/clang/test/CXX/special/class.inhctor/elsewhere.cpp b/clang/test/CXX/special/class.inhctor/elsewhere.cpp index c042834b214..f86f4b86faa 100644 --- a/clang/test/CXX/special/class.inhctor/elsewhere.cpp +++ b/clang/test/CXX/special/class.inhctor/elsewhere.cpp @@ -62,3 +62,4 @@ struct G : T { G(int &) : G(0) {} }; G<B1> g(123); +G<const B1> g2(123); |