[all-commits] [llvm/llvm-project] 94e604: [clang] preserve class type sugar when taking poin...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Mon Mar 10 09:26:47 PDT 2025


  Branch: refs/heads/users/mizvekov/clang-member-pointer-qualifier
  Home:   https://github.com/llvm/llvm-project
  Commit: 94e604f2b5c2d48cf23f456820f919d2b4541dbf
      https://github.com/llvm/llvm-project/commit/94e604f2b5c2d48cf23f456820f919d2b4541dbf
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-03-10 (Mon, 10 Mar 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
    M clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
    M clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
    M clang-tools-extra/clangd/unittests/FindTargetTests.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/ASTNodeTraverser.h
    M clang/include/clang/AST/CanonicalType.h
    M clang/include/clang/AST/RecursiveASTVisitor.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/AST/TypeLoc.h
    M clang/include/clang/AST/TypeProperties.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/lib/AST/ByteCode/Compiler.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/AST/NestedNameSpecifier.cpp
    M clang/lib/AST/ODRHash.cpp
    M clang/lib/AST/QualTypeNames.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/AST/TypePrinter.cpp
    M clang/lib/CodeGen/CGCXXABI.cpp
    M clang/lib/CodeGen/CGClass.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGExprCXX.cpp
    M clang/lib/CodeGen/CGPointerAuth.cpp
    M clang/lib/CodeGen/CGVTables.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenTypes.cpp
    M clang/lib/CodeGen/ItaniumCXXABI.cpp
    M clang/lib/CodeGen/MicrosoftCXXABI.cpp
    M clang/lib/Sema/SemaAccess.cpp
    M clang/lib/Sema/SemaCast.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaLookup.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/lib/Serialization/TemplateArgumentHasher.cpp
    M clang/test/AST/ast-dump-template-json-win32-mangler-crash.cpp
    M clang/test/AST/ast-dump-templates.cpp
    M clang/test/AST/ast-dump-types-json.cpp
    M clang/test/AST/attr-print-emit.cpp
    M clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
    M clang/test/CXX/class.access/p6.cpp
    M clang/test/CXX/drs/cwg0xx.cpp
    M clang/test/CXX/drs/cwg13xx.cpp
    M clang/test/CXX/drs/cwg26xx.cpp
    M clang/test/CXX/drs/cwg2xx.cpp
    M clang/test/CXX/drs/cwg4xx.cpp
    M clang/test/CXX/drs/cwg7xx.cpp
    M clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
    M clang/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
    M clang/test/Index/print-type.cpp
    M clang/test/SemaCXX/addr-of-overloaded-function.cpp
    M clang/test/SemaCXX/builtin-ptrtomember-ambig.cpp
    M clang/test/SemaCXX/calling-conv-compat.cpp
    M clang/test/SemaCXX/err_init_conversion_failed.cpp
    M clang/test/SemaCXX/member-pointer.cpp
    M clang/test/SemaCXX/sugar-common-types.cpp
    M clang/test/SemaOpenACC/combined-construct-if-ast.cpp
    M clang/test/SemaOpenACC/combined-construct-num_workers-ast.cpp
    M clang/test/SemaOpenACC/compute-construct-clause-ast.cpp
    M clang/test/SemaOpenACC/compute-construct-intexpr-clause-ast.cpp
    M clang/test/SemaOpenACC/data-construct-if-ast.cpp
    M clang/test/SemaTemplate/instantiate-member-pointers.cpp
    M clang/tools/libclang/CXType.cpp
    M clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

  Log Message:
  -----------
  [clang] preserve class type sugar when taking pointer to member

This changes the MemberPointerType representation to use
a NestedNameSpecifier instead of a Type to represent the base
class.

Since the qualifiers are always parsed as nested names, there
was an impedance mismatch when converting these back and
forth into types, and this led to issues in preserving
sugar.

The nested names are indeed a better match for these,
as the differences which a QualType can represent cannot be
expressed syntatically, and they represent the use case more
exactly, being either dependent or referring to a CXXRecord,
unqualified.

This patch also makes the MemberPointerType able to represent
sugar for a {up/downcast}cast conversion of the base class,
although for now the underlying type is canonical, as preserving
the sugar up to that point requires further work.

As usual, includes a few drive-by fixes in order to make use
of the improvements.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list