[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 10 08:02:31 PDT 2025
================
@@ -13461,13 +13486,112 @@ static ElaboratedTypeKeyword getCommonTypeKeyword(const T *X, const T *Y) {
: ElaboratedTypeKeyword::None;
}
+static NestedNameSpecifier *getCommonNNS(ASTContext &Ctx,
+ NestedNameSpecifier *X,
+ NestedNameSpecifier *Y, bool Sugar) {
+ if (X == Y)
+ return X;
+
+ NestedNameSpecifier *Canon = Ctx.getCanonicalNestedNameSpecifier(X);
+ if (Canon != Ctx.getCanonicalNestedNameSpecifier(Y)) {
+ if (Sugar)
----------------
erichkeane wrote:
`assert(Sugar && "Should be the same NestedNameSpecifier")` instead of the unreachable.
https://github.com/llvm/llvm-project/pull/130537
More information about the cfe-commits
mailing list