[PATCH] D47419: [SemaDeclCXX] Allow inheriting constructor declaration that specify a cv-qualified type
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 12 10:30:57 PDT 2019
rjmccall accepted this revision.
rjmccall added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lib/Sema/SemaDeclCXX.cpp:9690
+ CanQualType CanonicalDesiredBase = DesiredBase->getCanonicalTypeUnqualified()
+ .getUnqualifiedType();
for (auto &Base : Derived->bases()) {
----------------
cpplearner wrote:
> rsmith wrote:
> > How are we getting a qualified type here? Is this actually a bug in `getCanonicalTypeUnqualified`?
> It seems that `getCanonicalTypeUnqualified` does not strip qualifiers from the canonical type. I guess "Unqualified" here just means the method does not include local qualifiers, unlike QualType::getCanonicalType.
>
> Thus, in the case of `using cbase = const base;`, `getCanonicalTypeUnqualified` will return the canonical type of `cbase` as is, which is `const base`, a const-qualified type.
Maybe we should have a method that promises to return an unqualified type.
This change seems reasonable overall.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D47419/new/
https://reviews.llvm.org/D47419
More information about the cfe-commits
mailing list