summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTan S. B. <cpplearner@outlook.com>2019-08-17 20:57:52 +0000
committerTan S. B. <cpplearner@outlook.com>2019-08-17 20:57:52 +0000
commit8fd6aa5ed2d61d6ebba1185f59fe0e57fd218429 (patch)
tree2da4eca029adeb7e2365ba5531cd81613456fcd8
parent032e1fdcd47ef98936c88aa30571c6a713179a46 (diff)
downloadbcm5719-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.cpp3
-rw-r--r--clang/test/CXX/special/class.inhctor/elsewhere.cpp1
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);
OpenPOWER on IntegriCloud