[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 10 09:14:22 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) {
----------------
mizvekov wrote:

Yeah this is the convention we took on these functions, and LHS / RHS would not be accurate I think.
If we went with Something1 and Something2, instead of SomethingX and SomethingY, this would be another big patch to make consistent across the board.

I think X and Y for the parameters helps, instead of SomethingX, as it conveys its the kind the function operates on and returns.
For example, a getCommonType function gets the common types of X and Y, and getCommonNNS gets the common nested name of X and Y.

https://github.com/llvm/llvm-project/pull/130537


More information about the cfe-commits mailing list