[PATCH] D47419: [SemaDeclCXX] Allow inheriting constructor declaration that specify a cv-qualified type

S. B. Tam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 30 05:34:27 PDT 2018


cpplearner added inline comments.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:9690
+  CanQualType CanonicalDesiredBase = DesiredBase->getCanonicalTypeUnqualified()
+    .getUnqualifiedType();
   for (auto &Base : Derived->bases()) {
----------------
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.


Repository:
  rC Clang

https://reviews.llvm.org/D47419





More information about the cfe-commits mailing list