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

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

llvm-svn: 369196
This commit is contained in:
Tan S. B. 2019-08-17 20:57:52 +00:00
parent 032e1fdcd4
commit 8fd6aa5ed2
2 changed files with 3 additions and 1 deletions

View 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)

View File

@ -62,3 +62,4 @@ struct G : T {
G(int &) : G(0) {}
};
G<B1> g(123);
G<const B1> g2(123);