Skip to content

[clang] improve class type sugar preservation in pointers to members #130537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

mizvekov
Copy link
Contributor

This changes the MemberPointerType representation to use a NestedNameSpecifier instead of a Type to represent the 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 syntactically, and it also represents 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, and removing some duplications, for example CheckBaseClassAccess is deduplicated from across SemaAccess and SemaCast.

@mizvekov mizvekov self-assigned this Mar 10, 2025
@mizvekov mizvekov requested a review from Endilll as a code owner March 10, 2025 01:56
@llvmbot llvmbot added clang Clang issues not falling into any other category clang-tools-extra clangd clang-tidy clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:codegen IR generation bugs: mangling, exceptions, etc. clang:as-a-library libclang and C++ API clang:static analyzer debuginfo clang:openmp OpenMP related changes to Clang labels Mar 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 10, 2025

@llvm/pr-subscribers-clangd
@llvm/pr-subscribers-clang-static-analyzer-1
@llvm/pr-subscribers-clang-codegen
@llvm/pr-subscribers-clang-modules

@llvm/pr-subscribers-clang

Author: Matheus Izvekov (mizvekov)

Changes

This changes the MemberPointerType representation to use a NestedNameSpecifier instead of a Type to represent the 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 syntactically, and it also represents 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, and removing some duplications, for example CheckBaseClassAccess is deduplicated from across SemaAccess and SemaCast.


Patch is 183.99 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/130537.diff

81 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp (+1-4)
  • (modified) clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp (+1-2)
  • (modified) clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp (+5-3)
  • (modified) clang-tools-extra/clangd/unittests/FindTargetTests.cpp (+1-1)
  • (modified) clang/docs/ReleaseNotes.rst (+3-2)
  • (modified) clang/include/clang/AST/ASTContext.h (+3-4)
  • (modified) clang/include/clang/AST/ASTNodeTraverser.h (+5-2)
  • (modified) clang/include/clang/AST/CanonicalType.h (+3-1)
  • (modified) clang/include/clang/AST/RecursiveASTVisitor.h (+5-4)
  • (modified) clang/include/clang/AST/Type.h (+15-13)
  • (modified) clang/include/clang/AST/TypeLoc.h (+18-14)
  • (modified) clang/include/clang/AST/TypeProperties.td (+6-3)
  • (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (+2-4)
  • (modified) clang/include/clang/Sema/Sema.h (+28-11)
  • (modified) clang/lib/AST/ASTContext.cpp (+160-34)
  • (modified) clang/lib/AST/ASTImporter.cpp (+9-5)
  • (modified) clang/lib/AST/ASTStructuralEquivalence.cpp (+2-2)
  • (modified) clang/lib/AST/ByteCode/Compiler.cpp (+6-4)
  • (modified) clang/lib/AST/ExprConstant.cpp (+3-2)
  • (modified) clang/lib/AST/ItaniumMangle.cpp (+10-1)
  • (modified) clang/lib/AST/MicrosoftMangle.cpp (+5-5)
  • (modified) clang/lib/AST/NestedNameSpecifier.cpp (+1)
  • (modified) clang/lib/AST/ODRHash.cpp (+1-1)
  • (modified) clang/lib/AST/QualTypeNames.cpp (+4-3)
  • (modified) clang/lib/AST/Type.cpp (+39-12)
  • (modified) clang/lib/AST/TypePrinter.cpp (+2-2)
  • (modified) clang/lib/CodeGen/CGCXXABI.cpp (+3-4)
  • (modified) clang/lib/CodeGen/CGClass.cpp (+3-4)
  • (modified) clang/lib/CodeGen/CGDebugInfo.cpp (+2-1)
  • (modified) clang/lib/CodeGen/CGExprCXX.cpp (+4-4)
  • (modified) clang/lib/CodeGen/CGPointerAuth.cpp (+2-2)
  • (modified) clang/lib/CodeGen/CGVTables.cpp (+2-3)
  • (modified) clang/lib/CodeGen/CodeGenModule.cpp (+1-1)
  • (modified) clang/lib/CodeGen/CodeGenTypes.cpp (+1-1)
  • (modified) clang/lib/CodeGen/ItaniumCXXABI.cpp (+11-10)
  • (modified) clang/lib/CodeGen/MicrosoftCXXABI.cpp (+4-3)
  • (modified) clang/lib/Sema/SemaAccess.cpp (+26-19)
  • (modified) clang/lib/Sema/SemaCast.cpp (+16-66)
  • (modified) clang/lib/Sema/SemaDeclCXX.cpp (+23-25)
  • (modified) clang/lib/Sema/SemaExpr.cpp (+4-6)
  • (modified) clang/lib/Sema/SemaExprCXX.cpp (+35-19)
  • (modified) clang/lib/Sema/SemaLookup.cpp (+2-5)
  • (modified) clang/lib/Sema/SemaOpenMP.cpp (+2-3)
  • (modified) clang/lib/Sema/SemaOverload.cpp (+121-73)
  • (modified) clang/lib/Sema/SemaStmt.cpp (+2-1)
  • (modified) clang/lib/Sema/SemaTemplate.cpp (+6-2)
  • (modified) clang/lib/Sema/SemaTemplateDeduction.cpp (+16-5)
  • (modified) clang/lib/Sema/SemaType.cpp (+22-100)
  • (modified) clang/lib/Sema/TreeTransform.h (+29-30)
  • (modified) clang/lib/Serialization/ASTReader.cpp (+1-1)
  • (modified) clang/lib/Serialization/ASTWriter.cpp (+1-1)
  • (modified) clang/lib/Serialization/TemplateArgumentHasher.cpp (+3-1)
  • (modified) clang/test/AST/ast-dump-template-json-win32-mangler-crash.cpp (+3-1)
  • (modified) clang/test/AST/ast-dump-templates.cpp (+238)
  • (modified) clang/test/AST/ast-dump-types-json.cpp (+338-44)
  • (modified) clang/test/AST/attr-print-emit.cpp (+1-1)
  • (modified) clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp (+5-5)
  • (modified) clang/test/CXX/class.access/p6.cpp (+2-2)
  • (modified) clang/test/CXX/drs/cwg0xx.cpp (+6-6)
  • (modified) clang/test/CXX/drs/cwg13xx.cpp (+2-2)
  • (modified) clang/test/CXX/drs/cwg26xx.cpp (+3-3)
  • (modified) clang/test/CXX/drs/cwg2xx.cpp (+2-2)
  • (modified) clang/test/CXX/drs/cwg4xx.cpp (+1-1)
  • (modified) clang/test/CXX/drs/cwg7xx.cpp (+1-2)
  • (modified) clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp (+1-1)
  • (modified) clang/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp (+3-3)
  • (modified) clang/test/Index/print-type.cpp (+1-1)
  • (modified) clang/test/SemaCXX/addr-of-overloaded-function.cpp (+13-13)
  • (modified) clang/test/SemaCXX/builtin-ptrtomember-ambig.cpp (+2-2)
  • (modified) clang/test/SemaCXX/calling-conv-compat.cpp (+21-21)
  • (modified) clang/test/SemaCXX/err_init_conversion_failed.cpp (+1-1)
  • (modified) clang/test/SemaCXX/member-pointer.cpp (+13-4)
  • (modified) clang/test/SemaCXX/sugar-common-types.cpp (+2-2)
  • (modified) clang/test/SemaOpenACC/combined-construct-if-ast.cpp (+2-2)
  • (modified) clang/test/SemaOpenACC/combined-construct-num_workers-ast.cpp (+2-2)
  • (modified) clang/test/SemaOpenACC/compute-construct-clause-ast.cpp (+2-2)
  • (modified) clang/test/SemaOpenACC/compute-construct-intexpr-clause-ast.cpp (+2-2)
  • (modified) clang/test/SemaOpenACC/data-construct-if-ast.cpp (+2-2)
  • (modified) clang/test/SemaTemplate/instantiate-member-pointers.cpp (+2-1)
  • (modified) clang/tools/libclang/CXType.cpp (+3-1)
  • (modified) clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp (+4-4)
diff --git a/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
index 9d1d92b989bf1..a8a9e6bdcdff8 100644
--- a/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
@@ -70,10 +70,7 @@ void ComparePointerToMemberVirtualFunctionCheck::check(
   // compare with variable which type is pointer to member function.
   llvm::SmallVector<SourceLocation, 12U> SameSignatureVirtualMethods{};
   const auto *MPT = cast<MemberPointerType>(DRE->getType().getCanonicalType());
-  const Type *T = MPT->getClass();
-  if (T == nullptr)
-    return;
-  const CXXRecordDecl *RD = T->getAsCXXRecordDecl();
+  const CXXRecordDecl *RD = MPT->getMostRecentCXXRecordDecl();
   if (RD == nullptr)
     return;
 
diff --git a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
index 108717e151b57..a6b00be75abf8 100644
--- a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
@@ -493,8 +493,7 @@ UseNullptrCheck::UseNullptrCheck(StringRef Name, ClangTidyContext *Context)
     : ClangTidyCheck(Name, Context),
       NullMacrosStr(Options.get("NullMacros", "NULL")),
       IgnoredTypes(utils::options::parseStringList(Options.get(
-          "IgnoredTypes",
-          "std::_CmpUnspecifiedParam::;^std::__cmp_cat::__unspec"))) {
+          "IgnoredTypes", "_CmpUnspecifiedParam;^std::__cmp_cat::__unspec"))) {
   StringRef(NullMacrosStr).split(NullMacros, ",");
 }
 
diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
index 0fea7946a59f9..bc49fa856bafc 100644
--- a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
+++ b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
@@ -178,7 +178,9 @@ bool isFunctionPointerConvertible(QualType From, QualType To) {
 
     // Note: converting Derived::* to Base::* is a different kind of conversion,
     // called Pointer-to-member conversion.
-    return FromMember->getClass() == ToMember->getClass() &&
+    return FromMember->getQualifier() == ToMember->getQualifier() &&
+           FromMember->getMostRecentCXXRecordDecl() ==
+               ToMember->getMostRecentCXXRecordDecl() &&
            FromMember->getPointeeType() == ToMember->getPointeeType();
   }
 
@@ -219,8 +221,8 @@ bool isQualificationConvertiblePointer(QualType From, QualType To,
 
     if (P1->isMemberPointerType())
       return P2->isMemberPointerType() &&
-             P1->getAs<MemberPointerType>()->getClass() ==
-                 P2->getAs<MemberPointerType>()->getClass();
+             P1->getAs<MemberPointerType>()->getMostRecentCXXRecordDecl() ==
+                 P2->getAs<MemberPointerType>()->getMostRecentCXXRecordDecl();
 
     if (P1->isConstantArrayType())
       return P2->isConstantArrayType() &&
diff --git a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp
index fc54f89f4941e..602f61d9ecb41 100644
--- a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp
+++ b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp
@@ -1489,7 +1489,7 @@ TEST_F(FindExplicitReferencesTest, AllRefsInFoo) {
         "4: targets = {a}\n"
         "5: targets = {a::b}, qualifier = 'a::'\n"
         "6: targets = {a::b::S}\n"
-        "7: targets = {a::b::S::type}, qualifier = 'struct S::'\n"
+        "7: targets = {a::b::S::type}, qualifier = 'S::'\n"
         "8: targets = {y}, decl\n"},
        {R"cpp(
          void foo() {
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 7859871b0493a..c2130acbe51bf 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -161,8 +161,8 @@ related warnings within the method body.
   ``__attribute__((model("large")))`` on non-TLS globals in x86-64 compilations.
   This forces the global to be considered small or large in regards to the
   x86-64 code model, regardless of the code model specified for the compilation.
-- Clang now emits a warning ``-Wreserved-init-priority`` instead of a hard error 
-  when ``__attribute__((init_priority(n)))`` is used with values of n in the 
+- Clang now emits a warning ``-Wreserved-init-priority`` instead of a hard error
+  when ``__attribute__((init_priority(n)))`` is used with values of n in the
   reserved range [0, 100]. The warning will be treated as an error by default.
 
 - There is a new ``format_matches`` attribute to complement the existing
@@ -233,6 +233,7 @@ Improvements to Clang's diagnostics
   under the subgroup ``-Wunsafe-buffer-usage-in-libc-call``.
 - Diagnostics on chained comparisons (``a < b < c``) are now an error by default. This can be disabled with
   ``-Wno-error=parentheses``.
+- Better preservation of member pointer type sugar.
 - The ``-Wshift-bool`` warning has been added to warn about shifting a boolean. (#GH28334)
 
 - The :doc:`ThreadSafetyAnalysis` now supports ``-Wthread-safety-pointer``,
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index f9a12260a6590..af8c49e99a7ce 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -1558,10 +1558,9 @@ class ASTContext : public RefCountedBase<ASTContext> {
   QualType getRValueReferenceType(QualType T) const;
 
   /// Return the uniqued reference to the type for a member pointer to
-  /// the specified type in the specified class.
-  ///
-  /// The class \p Cls is a \c Type because it could be a dependent name.
-  QualType getMemberPointerType(QualType T, const Type *Cls) const;
+  /// the specified type in the specified nested name.
+  QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
+                                const CXXRecordDecl *Cls) const;
 
   /// Return a non-unique reference to the type for a variable array of
   /// the specified element type.
diff --git a/clang/include/clang/AST/ASTNodeTraverser.h b/clang/include/clang/AST/ASTNodeTraverser.h
index 3bc0bdff2bdd1..f557555e96e59 100644
--- a/clang/include/clang/AST/ASTNodeTraverser.h
+++ b/clang/include/clang/AST/ASTNodeTraverser.h
@@ -393,7 +393,9 @@ class ASTNodeTraverser
     Visit(T->getPointeeType());
   }
   void VisitMemberPointerType(const MemberPointerType *T) {
-    Visit(T->getClass());
+    // FIXME: Provide a NestedNameSpecifier visitor.
+    Visit(T->getQualifier()->getAsType());
+    Visit(T->getMostRecentCXXRecordDecl());
     Visit(T->getPointeeType());
   }
   void VisitArrayType(const ArrayType *T) { Visit(T->getElementType()); }
@@ -485,7 +487,8 @@ class ASTNodeTraverser
     }
   }
   void VisitMemberPointerTypeLoc(MemberPointerTypeLoc TL) {
-    Visit(TL.getClassTInfo()->getTypeLoc());
+    // FIXME: Provide NestedNamespecifierLoc visitor.
+    Visit(TL.getQualifierLoc().getTypeLoc());
   }
   void VisitVariableArrayTypeLoc(VariableArrayTypeLoc TL) {
     Visit(TL.getSizeExpr());
diff --git a/clang/include/clang/AST/CanonicalType.h b/clang/include/clang/AST/CanonicalType.h
index 6699284d215bd..35db68971e029 100644
--- a/clang/include/clang/AST/CanonicalType.h
+++ b/clang/include/clang/AST/CanonicalType.h
@@ -453,7 +453,9 @@ template<>
 struct CanProxyAdaptor<MemberPointerType>
   : public CanProxyBase<MemberPointerType> {
   LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getPointeeType)
-  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const Type *, getClass)
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(NestedNameSpecifier *, getQualifier)
+  LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(const CXXRecordDecl *,
+                                      getMostRecentCXXRecordDecl)
 };
 
 // CanProxyAdaptors for arrays are intentionally unimplemented because
diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h
index 5ca3e435f033b..67025eb7a5a38 100644
--- a/clang/include/clang/AST/RecursiveASTVisitor.h
+++ b/clang/include/clang/AST/RecursiveASTVisitor.h
@@ -1004,7 +1004,8 @@ DEF_TRAVERSE_TYPE(RValueReferenceType,
                   { TRY_TO(TraverseType(T->getPointeeType())); })
 
 DEF_TRAVERSE_TYPE(MemberPointerType, {
-  TRY_TO(TraverseType(QualType(T->getClass(), 0)));
+  TRY_TO(TraverseNestedNameSpecifier(T->getQualifier()));
+  TRY_TO(TraverseDecl(T->getMostRecentCXXRecordDecl()));
   TRY_TO(TraverseType(T->getPointeeType()));
 })
 
@@ -1269,10 +1270,10 @@ DEF_TRAVERSE_TYPELOC(RValueReferenceType,
 // We traverse this in the type case as well, but how is it not reached through
 // the pointee type?
 DEF_TRAVERSE_TYPELOC(MemberPointerType, {
-  if (auto *TSI = TL.getClassTInfo())
-    TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
+  if (NestedNameSpecifierLoc QL = TL.getQualifierLoc())
+    TRY_TO(TraverseNestedNameSpecifierLoc(QL));
   else
-    TRY_TO(TraverseType(QualType(TL.getTypePtr()->getClass(), 0)));
+    TRY_TO(TraverseNestedNameSpecifier(TL.getTypePtr()->getQualifier()));
   TRY_TO(TraverseTypeLoc(TL.getPointeeLoc()));
 })
 
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index ef59bd1621fb8..84f40025b07fc 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -3524,14 +3524,16 @@ class MemberPointerType : public Type, public llvm::FoldingSetNode {
   QualType PointeeType;
 
   /// The class of which the pointee is a member. Must ultimately be a
-  /// RecordType, but could be a typedef or a template parameter too.
-  const Type *Class;
+  /// CXXRecordType, but could be a typedef or a template parameter too.
+  NestedNameSpecifier *Qualifier;
 
-  MemberPointerType(QualType Pointee, const Type *Cls, QualType CanonicalPtr)
+  MemberPointerType(QualType Pointee, NestedNameSpecifier *Qualifier,
+                    QualType CanonicalPtr)
       : Type(MemberPointer, CanonicalPtr,
-             (Cls->getDependence() & ~TypeDependence::VariablyModified) |
+             (toTypeDependence(Qualifier->getDependence()) &
+              ~TypeDependence::VariablyModified) |
                  Pointee->getDependence()),
-        PointeeType(Pointee), Class(Cls) {}
+        PointeeType(Pointee), Qualifier(Qualifier) {}
 
 public:
   QualType getPointeeType() const { return PointeeType; }
@@ -3548,21 +3550,21 @@ class MemberPointerType : public Type, public llvm::FoldingSetNode {
     return !PointeeType->isFunctionProtoType();
   }
 
-  const Type *getClass() const { return Class; }
+  NestedNameSpecifier *getQualifier() const { return Qualifier; }
   CXXRecordDecl *getMostRecentCXXRecordDecl() const;
 
-  bool isSugared() const { return false; }
-  QualType desugar() const { return QualType(this, 0); }
+  bool isSugared() const;
+  QualType desugar() const {
+    return isSugared() ? getCanonicalTypeInternal() : QualType(this, 0);
+  }
 
   void Profile(llvm::FoldingSetNodeID &ID) {
-    Profile(ID, getPointeeType(), getClass());
+    Profile(ID, getPointeeType(), getQualifier(), getMostRecentCXXRecordDecl());
   }
 
   static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee,
-                      const Type *Class) {
-    ID.AddPointer(Pointee.getAsOpaquePtr());
-    ID.AddPointer(Class);
-  }
+                      const NestedNameSpecifier *Qualifier,
+                      const CXXRecordDecl *Cls);
 
   static bool classof(const Type *T) {
     return T->getTypeClass() == MemberPointer;
diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h
index a55a38335ef6a..0fca6e522e03b 100644
--- a/clang/include/clang/AST/TypeLoc.h
+++ b/clang/include/clang/AST/TypeLoc.h
@@ -1355,7 +1355,7 @@ class BlockPointerTypeLoc : public PointerLikeTypeLoc<BlockPointerTypeLoc,
 };
 
 struct MemberPointerLocInfo : public PointerLikeLocInfo {
-  TypeSourceInfo *ClassTInfo;
+  void *QualifierData;
 };
 
 /// Wrapper for source info for member pointers.
@@ -1371,28 +1371,32 @@ class MemberPointerTypeLoc : public PointerLikeTypeLoc<MemberPointerTypeLoc,
     setSigilLoc(Loc);
   }
 
-  const Type *getClass() const {
-    return getTypePtr()->getClass();
-  }
-
-  TypeSourceInfo *getClassTInfo() const {
-    return getLocalData()->ClassTInfo;
+  NestedNameSpecifierLoc getQualifierLoc() const {
+    return NestedNameSpecifierLoc(getTypePtr()->getQualifier(),
+                                  getLocalData()->QualifierData);
   }
 
-  void setClassTInfo(TypeSourceInfo* TI) {
-    getLocalData()->ClassTInfo = TI;
+  void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc) {
+    assert(QualifierLoc.getNestedNameSpecifier() ==
+               getTypePtr()->getQualifier() &&
+           "Inconsistent nested-name-specifier pointer");
+    getLocalData()->QualifierData = QualifierLoc.getOpaqueData();
   }
 
   void initializeLocal(ASTContext &Context, SourceLocation Loc) {
     setSigilLoc(Loc);
-    setClassTInfo(nullptr);
+    if (auto *Qualifier = getTypePtr()->getQualifier()) {
+      NestedNameSpecifierLocBuilder Builder;
+      Builder.MakeTrivial(Context, Qualifier, Loc);
+      setQualifierLoc(Builder.getWithLocInContext(Context));
+    } else
+      getLocalData()->QualifierData = nullptr;
   }
 
   SourceRange getLocalSourceRange() const {
-    if (TypeSourceInfo *TI = getClassTInfo())
-      return SourceRange(TI->getTypeLoc().getBeginLoc(), getStarLoc());
-    else
-      return SourceRange(getStarLoc());
+    if (NestedNameSpecifierLoc QL = getQualifierLoc())
+      return SourceRange(QL.getBeginLoc(), getStarLoc());
+    return SourceRange(getStarLoc());
   }
 };
 
diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td
index 6f1a76bd18fb5..27f71bf5cc62f 100644
--- a/clang/include/clang/AST/TypeProperties.td
+++ b/clang/include/clang/AST/TypeProperties.td
@@ -100,12 +100,15 @@ let Class = MemberPointerType in {
   def : Property<"pointeeType", QualType> {
     let Read = [{ node->getPointeeType() }];
   }
-  def : Property<"baseType", QualType> {
-    let Read = [{ QualType(node->getClass(), 0) }];
+  def : Property<"Qualifier", NestedNameSpecifier> {
+    let Read = [{ node->getQualifier() }];
+  }
+  def : Property<"Cls", DeclRef> {
+    let Read = [{ node->getMostRecentCXXRecordDecl() }];
   }
 
   def : Creator<[{
-    return ctx.getMemberPointerType(pointeeType, baseType.getTypePtr());
+    return ctx.getMemberPointerType(pointeeType, Qualifier, cast_or_null<CXXRecordDecl>(Cls));
   }]>;
 }
 
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 88d3fb35eea5c..80d3ca6b16bbb 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -7038,10 +7038,8 @@ def err_illegal_decl_mempointer_to_reference : Error<
   "'%0' declared as a member pointer to a reference of type %1">;
 def err_illegal_decl_mempointer_to_void : Error<
   "'%0' declared as a member pointer to void">;
-def err_illegal_decl_mempointer_in_nonclass : Error<
-  "'%0' does not point into a class">;
-def err_mempointer_in_nonclass_type : Error<
-  "member pointer refers into non-class type %0">;
+def err_illegal_decl_mempointer_in_nonclass
+    : Error<"'%0' does not point into a class">;
 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
 def err_nonfunction_block_type : Error<
   "block pointer to non-function type is invalid">;
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index fdef57e84ee3d..35a9eb48204de 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -1348,6 +1348,12 @@ class Sema final : public SemaBase {
                                     unsigned DiagID, bool ForceCheck = false,
                                     bool ForceUnprivileged = false);
 
+  AccessResult CheckBaseClassAccess(
+      SourceLocation AccessLoc, CXXRecordDecl *Base, CXXRecordDecl *Derived,
+      const CXXBasePath &Path, unsigned DiagID,
+      llvm::function_ref<void(PartialDiagnostic &PD)> SetupPDiag,
+      bool ForceCheck = false, bool ForceUnprivileged = false);
+
   /// Checks access to all the declarations in the given result set.
   void CheckLookupAccess(const LookupResult &R);
 
@@ -5747,10 +5753,11 @@ class Sema final : public SemaBase {
 
   /// Determine whether the type \p Derived is a C++ class that is
   /// derived from the type \p Base.
+  bool IsDerivedFrom(SourceLocation Loc, CXXRecordDecl *Derived,
+                     CXXRecordDecl *Base, CXXBasePaths &Paths);
+  bool IsDerivedFrom(SourceLocation Loc, CXXRecordDecl *Derived,
+                     CXXRecordDecl *Base);
   bool IsDerivedFrom(SourceLocation Loc, QualType Derived, QualType Base);
-
-  /// Determine whether the type \p Derived is a C++ class that is
-  /// derived from the type \p Base.
   bool IsDerivedFrom(SourceLocation Loc, QualType Derived, QualType Base,
                      CXXBasePaths &Paths);
 
@@ -10033,15 +10040,24 @@ class Sema final : public SemaBase {
                                  bool InOverloadResolution,
                                  QualType &ConvertedType);
 
+  enum class CheckMemberPointerConversionResult {
+    Success,
+    DifferentPointee,
+    NotDerived,
+    Ambiguous,
+    Virtual,
+    Inaccessible
+  };
+  enum class CheckMemberPointerConversionDirection : bool { Downcast, Upcast };
   /// CheckMemberPointerConversion - Check the member pointer conversion from
   /// the expression From to the type ToType. This routine checks for ambiguous
   /// or virtual or inaccessible base-to-derived member pointer conversions for
-  /// which IsMemberPointerConversion has already returned true. It returns true
-  /// and produces a diagnostic if there was an error, or returns false
-  /// otherwise.
-  bool CheckMemberPointerConversion(Expr *From, QualType ToType, CastKind &Kind,
-                                    CXXCastPath &BasePath,
-                                    bool IgnoreBaseAccess);
+  /// which IsMemberPointerConversion has already returned true. It produces a
+  // diagnostic if there was an error.
+  CheckMemberPointerConversionResult CheckMemberPointerConversion(
+      QualType FromType, const MemberPointerType *ToPtrType, CastKind &Kind,
+      CXXCastPath &BasePath, SourceLocation CheckLoc, SourceRange OpRange,
+      bool IgnoreBaseAccess, CheckMemberPointerConversionDirection Direction);
 
   /// IsQualificationConversion - Determines whether the conversion from
   /// an rvalue of type FromType to ToType is a qualification conversion
@@ -14869,8 +14885,9 @@ class Sema final : public SemaBase {
   ///
   /// \returns a member pointer type, if successful, or a NULL type if there was
   /// an error.
-  QualType BuildMemberPointerType(QualType T, QualType Class,
-                                  SourceLocation Loc, DeclarationName Entity);
+  QualType BuildMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
+                                  CXXRecordDecl *Cls, SourceLocation Loc,
+                                  DeclarationName Entity);
 
   /// Build a block pointer type.
   ///
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index fce1c34897da7..a98e749e025fc 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3321,7 +3321,8 @@ static void encodeTypeForFunctionPointerAuth(const ASTContext &Ctx,
   case Type::MemberPointer: {
     OS << "M";
     const auto *MPT = T->castAs<MemberPointerType>();
-    encodeTypeForFunctionPointerAuth(Ctx, OS, QualType(MPT->getClass(), 0));
+    encodeTypeForFunctionPointerAuth(
+        Ctx, OS, QualType(MPT->getQualifier()->getAsType(), 0));
     encodeTypeForFunctionPointerAuth(Ctx, OS, MPT->getPointeeType());
     return;
   }
@@ -3510,7 +3511,8 @@ uint16_t ASTContext::getPointerAuthTypeDiscriminator(QualType T) {
         if (PointeeType->castAs<FunctionProtoType>()->getExceptionSpecType() !=
             EST_None) {
           QualType FT = getFunctionTypeWithExceptionSpec(PointeeType, EST_None);
-          T = getMemberPointerType(FT, MPT->getClass());
+          T = getMemberPointerType(FT, MPT->getQualifier(),
+                                   MPT->getMostRecentCXXRecordDecl());
         }
       }
     std::unique_ptr<MangleContext> MC(createMangleContext());
@@ -4024,32 +4026...
[truncated]

Copy link
Contributor

@Endilll Endilll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to C++ DR tests look good.

FIXME: why diagnostic says just Y and not cwg794::Y, like cwg794::X?

This FIXME resolved in the opposite direction I anticipated back when I wrote it, but that's fine, as long as we print both types in a consistent manner.

@mizvekov mizvekov force-pushed the users/mizvekov/clang-nns-print-improv branch 2 times, most recently from 87d712f to 7b6eae7 Compare March 10, 2025 11:28
Base automatically changed from users/mizvekov/clang-nns-print-improv to main March 10, 2025 12:37
Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch ended up being pretty massive... ANYTHING we can do to reduce the size of this would be very appreciated.

I DID NOT do more than a cursory look over the tests, so if someone else could do some work to make sure there isn't anything awkward/weird happening, I'd appreciate it.

Otherwise, I have some minor concerns/issues, but the code itself seems fine.

@mizvekov
Copy link
Contributor Author

This patch ended up being pretty massive... ANYTHING we can do to reduce the size of this would be very appreciated.

It might be possible to split some stuff, but it would be hard to test it individually and avoid regressions in between the patches.

@mizvekov mizvekov force-pushed the users/mizvekov/clang-member-pointer-qualifier branch from fb38f66 to 94e604f Compare March 10, 2025 16:26
@mizvekov
Copy link
Contributor Author

A dependent PR had been merged meanwhile, and this was not rebased.

While this patch is still big, you might have been seeing way more stuff than was actually in the PR.

I just rebased, but have not addressed any comments yet.

@tbaederr
Copy link
Contributor

Could you run this through the compile time tracker?

@mizvekov
Copy link
Contributor Author

@mizvekov mizvekov force-pushed the users/mizvekov/clang-member-pointer-qualifier branch from 94e604f to c1c419d Compare March 18, 2025 19:22
@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 20, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building clang-tools-extra,clang at step 10 "Add check check-libc-amdgcn-amd-amdhsa".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/1752

Here is the relevant piece of the build log for the reference
Step 10 (Add check check-libc-amdgcn-amd-amdhsa) failure: test (failure)
...
[196/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextupl.__internal__.dir/nextupl.cpp.o
[197/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fromfpl.__internal__.dir/fromfpl.cpp.o
[198/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextdown.__internal__.dir/nextdown.cpp.o
[199/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextupf.__internal__.dir/nextupf.cpp.o
[200/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fromfpf16.__internal__.dir/fromfpf16.cpp.o
[201/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.nexttowardf16.__internal__.dir/nexttowardf16.cpp.o
[202/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextdownf.__internal__.dir/nextdownf.cpp.o
[203/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.nextupf16.__internal__.dir/nextupf16.cpp.o
[204/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fromfpxf.__internal__.dir/fromfpxf.cpp.o
[205/2772] Building CXX object libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o
FAILED: libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o 
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc -isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/include/amdgcn-amd-amdhsa -O3 -DNDEBUG -UNDEBUG --target=amdgcn-amd-amdhsa -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -Wno-multi-gpu -nogpulib -mcpu=native -flto -mcode-object-version=5 -MD -MT libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -MF libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o.d -o libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -c /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp
clang++: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/include/clang/AST/ASTContext.h:1704: clang::QualType clang::ASTContext::getTypeDeclType(const clang::TypeDecl*, const clang::TypeDecl*) const: Assertion `Decl && "Passed null for Decl param"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc -isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/include/amdgcn-amd-amdhsa -O3 -DNDEBUG -UNDEBUG --target=amdgcn-amd-amdhsa -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -Wno-multi-gpu -nogpulib -mcpu=native -flto -mcode-object-version=5 -MD -MT libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -MF libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o.d -o libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -c /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp
1.	/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:337:3 <Spelling=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:337:38>: current parser token ')'
2.	/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:15:1: parsing namespace '__llvm_libc_21_0_0_git'
3.	/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:16:1: parsing namespace '__llvm_libc_21_0_0_git::cpp'
4.	/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:326:40: parsing function body '__llvm_libc_21_0_0_git::cpp::LlvmLibcTypeTraitsTest_is_class::Run'
5.	/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:326:40: in compound statement ('{}')
6.	/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/src/__support/CPP/type_traits/is_class.h:27:32: instantiating variable definition '__llvm_libc_21_0_0_git::cpp::is_class_v<__llvm_libc_21_0_0_git::cpp::EnumClass>'
7.	/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/src/__support/CPP/type_traits/is_class.h:25:27: instantiating class definition '__llvm_libc_21_0_0_git::cpp::is_class<__llvm_libc_21_0_0_git::cpp::EnumClass>'
  #0 0x000070c4db5e49b0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/libLLVMSupport.so.21.0git+0x1e49b0)
  #1 0x000070c4db5e1dbf llvm::sys::RunSignalHandlers() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/libLLVMSupport.so.21.0git+0x1e1dbf)
  #2 0x000070c4db4df018 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
  #3 0x000070c4dac42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
  #4 0x000070c4dac969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
  #5 0x000070c4dac969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
  #6 0x000070c4dac969fc pthread_kill ./nptl/pthread_kill.c:89:10
  #7 0x000070c4dac42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
  #8 0x000070c4dac287f3 abort ./stdlib/abort.c:81:7
  #9 0x000070c4dac2871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
 #10 0x000070c4dac39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #11 0x000070c4d81f9a06 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0xdf9a06)
 #12 0x000070c4d81f9af9 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0xdf9af9)
 #13 0x000070c4d7aaf000 clang::Sema::GatherArgumentsForCall(clang::SourceLocation, clang::FunctionDecl*, clang::FunctionProtoType const*, unsigned int, llvm::ArrayRef<clang::Expr*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::Sema::VariadicCallType, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0x6af000)
 #14 0x000070c4d7ab0344 clang::Sema::ConvertArgumentsForCall(clang::CallExpr*, clang::Expr*, clang::FunctionDecl*, clang::FunctionProtoType const*, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0x6b0344)
 #15 0x000070c4d7ab1d97 clang::Sema::BuildResolvedCallExpr(clang::Expr*, clang::NamedDecl*, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, clang::CallExpr::ADLCallKind) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0x6b1d97)
 #16 0x000070c4d7ea56f3 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0xaa56f3)
 #17 0x000070c4d7a661ba clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0x6661ba)
 #18 0x000070c4d7a66e77 clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0x666e77)
 #19 0x000070c4d8134a65 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #20 0x000070c4d8111056 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #21 0x000070c4d811629a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
 #22 0x000070c4d8119fca clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0xd19fca)
 #23 0x000070c4d811a510 clang::Sema::SubstBaseSpecifiers(clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0xd1a510)
 #24 0x000070c4d811af82 clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0xd1af82)
 #25 0x000070c4d816e405 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/../lib/../lib/libclangSema.so.21.0git+0xd6e405)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 20, 2025

LLVM Buildbot has detected a new failure on builder lldb-arm-ubuntu running on linaro-lldb-arm-ubuntu while building clang-tools-extra,clang at step 4 "build".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/13228

Here is the relevant piece of the build log for the reference
Step 4 (build) failure: build (failure)
...
  796 |       -1'096'193'779'200; // -32767-01-01T00:00:00Z
      |       ^~~~~~~~~~~~~~~~~~
../llvm-project/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp:798:7: warning: implicit conversion from 'long long' to 'const std::time_t' (aka 'const long') changes value from 971890963199 to 1228354303 [-Wconstant-conversion]
  797 |   const std::time_t chrono_timestamp_max =
      |                     ~~~~~~~~~~~~~~~~~~~~
  798 |       971'890'963'199; // 32767-12-31T23:59:59Z
      |       ^~~~~~~~~~~~~~~
2 warnings generated.
222.602 [139/12/6400] Building CXX object tools/lldb/source/Plugins/SymbolFile/CTF/CMakeFiles/lldbPluginSymbolFileCTF.dir/SymbolFileCTF.cpp.o
224.526 [139/11/6401] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o
FAILED: tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o 
/usr/local/bin/c++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/source/Plugins/SymbolFile/NativePDB -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/llvm/include -I/usr/include/python3.10 -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/llvm/../clang/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/../clang/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/source -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -MF tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o.d -o tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -c /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
../llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:565:46: error: too few arguments to function call, expected 3, have 2
  564 |     return m_clang.getASTContext().getMemberPointerType(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  565 |         pointee_type, class_type.getTypePtr());
      |                                              ^
../llvm-project/clang/include/clang/AST/ASTContext.h:1562:12: note: 'getMemberPointerType' declared here
 1562 |   QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
      |            ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1563 |                                 const CXXRecordDecl *Cls) const;
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
227.197 [139/10/6402] Building CXX object tools/clang/tools/clang-scan-deps/CMakeFiles/clang-scan-deps.dir/ClangScanDeps.cpp.o
227.541 [139/9/6403] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/PDBASTParser.cpp.o
228.229 [139/8/6404] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/UdtRecordCompleter.cpp.o
229.245 [139/7/6405] Building CXX object tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o
FAILED: tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o 
/usr/local/bin/c++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/source/Plugins/TypeSystem/Clang -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/source/Plugins/TypeSystem/Clang -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/llvm/include -I/usr/include/python3.10 -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/llvm/../clang/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/../clang/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/source -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o -MF tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o.d -o tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o -c /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
../llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:2775:16: error: no member named 'getClass' in 'clang::MemberPointerType'
 2775 |       if (MPT->getClass()->isRecordType())
      |           ~~~  ^
../llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:2776:57: error: no member named 'getClass' in 'clang::MemberPointerType'
 2776 |         GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
      |                                                    ~~~  ^
../llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:8614:50: error: too few arguments to function call, expected 3, have 2
 8612 |     return ast->GetType(ast->getASTContext().getMemberPointerType(
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 8613 |         ClangUtil::GetQualType(pointee_type),
 8614 |         ClangUtil::GetQualType(type).getTypePtr()));
      |                                                  ^
../llvm-project/clang/include/clang/AST/ASTContext.h:1562:12: note: 'getMemberPointerType' declared here
 1562 |   QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
      |            ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1563 |                                 const CXXRecordDecl *Cls) const;
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
230.192 [139/6/6406] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/DWARFASTParserClang.cpp.o
230.287 [139/5/6407] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/SymbolFilePDB.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 20, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-libc-amdgpu-runtime running on omp-vega20-1 while building clang-tools-extra,clang at step 7 "Add check check-offload".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/14958

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-offload) failure: test (failure)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: offloading/gpupgo/pgo2.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp    -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-generate
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-generate
# RUN: at line 2
env LLVM_PROFILE_FILE=pgo2.c.llvm.profraw      /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp 2>&1
# executed command: env LLVM_PROFILE_FILE=pgo2.c.llvm.profraw /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp
# RUN: at line 4
llvm-profdata show --all-functions --counts      pgo2.c.llvm.profraw | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c      --check-prefix="LLVM-HOST"
# executed command: llvm-profdata show --all-functions --counts pgo2.c.llvm.profraw
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c --check-prefix=LLVM-HOST
# RUN: at line 7
llvm-profdata show --all-functions --counts      amdgcn-amd-amdhsa.pgo2.c.llvm.profraw      | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c --check-prefix="LLVM-DEVICE"
# executed command: llvm-profdata show --all-functions --counts amdgcn-amd-amdhsa.pgo2.c.llvm.profraw
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c --check-prefix=LLVM-DEVICE
# RUN: at line 11
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp    -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-instr-generate
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a -fprofile-instr-generate
# RUN: at line 12
env LLVM_PROFILE_FILE=pgo2.c.clang.profraw      /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp 2>&1
# executed command: env LLVM_PROFILE_FILE=pgo2.c.clang.profraw /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/gpupgo/Output/pgo2.c.tmp
# RUN: at line 14
llvm-profdata show --all-functions --counts      pgo2.c.clang.profraw | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c      --check-prefix="CLANG-HOST"
# executed command: llvm-profdata show --all-functions --counts pgo2.c.clang.profraw
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c --check-prefix=CLANG-HOST
# RUN: at line 17
llvm-profdata show --all-functions --counts      amdgcn-amd-amdhsa.pgo2.c.clang.profraw |      /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c --check-prefix="CLANG-DEV"
# executed command: llvm-profdata show --all-functions --counts amdgcn-amd-amdhsa.pgo2.c.clang.profraw
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c --check-prefix=CLANG-DEV
# .---command stderr------------
# | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c:101:15: error: CLANG-DEV: expected string not found in input
# | // CLANG-DEV: Block counts: [11]
# |               ^
# | <stdin>:5:19: note: scanning from here
# |  Function count: 0
# |                   ^
# | <stdin>:6:2: note: possible intended match here
# |  Block counts: [14]
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/offloading/gpupgo/pgo2.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
...
Step 8 (Add check check-libc-amdgcn-amd-amdhsa) failure: test (failure)
...
[179/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fminimum_mag_numl.__internal__.dir/fminimum_mag_numl.cpp.o
[180/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fminimum_mag_numf16.__internal__.dir/fminimum_mag_numf16.cpp.o
[181/2772] Building CXX object libc/src/string/CMakeFiles/libc.src.string.memcpy.__internal__.dir/memcpy.cpp.o
[182/2772] Building CXX object libc/src/string/CMakeFiles/libc.src.string.memmove.__internal__.dir/memmove.cpp.o
[183/2772] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strtok_r.__internal__.dir/strtok_r.cpp.o
[184/2772] Building CXX object libc/src/string/CMakeFiles/libc.src.string.memset.__internal__.dir/memset.cpp.o
[185/2772] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.__internal__.dir/fmul.cpp.o
[186/2772] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bzero.__internal__.dir/bzero.cpp.o
[187/2772] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bcopy.__internal__.dir/bcopy.cpp.o
[188/2772] Building CXX object libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o
FAILED: libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o 
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc -isystem /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa -O3 -DNDEBUG -UNDEBUG --target=amdgcn-amd-amdhsa -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -Wno-multi-gpu -nogpulib -mcpu=gfx906 -flto -mcode-object-version=5 -MD -MT libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -MF libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o.d -o libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -c /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp
clang++: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/clang/include/clang/AST/ASTContext.h:1704: clang::QualType clang::ASTContext::getTypeDeclType(const clang::TypeDecl*, const clang::TypeDecl*) const: Assertion `Decl && "Passed null for Decl param"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc -isystem /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/include/amdgcn-amd-amdhsa -O3 -DNDEBUG -UNDEBUG --target=amdgcn-amd-amdhsa -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -Wno-multi-gpu -nogpulib -mcpu=gfx906 -flto -mcode-object-version=5 -MD -MT libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -MF libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o.d -o libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.type_traits_test.__hermetic__.__build__.dir/type_traits_test.cpp.o -c /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp
1.	/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:337:3 <Spelling=/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:337:38>: current parser token ')'
2.	/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:15:1: parsing namespace '__llvm_libc_21_0_0_git'
3.	/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:16:1: parsing namespace '__llvm_libc_21_0_0_git::cpp'
4.	/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:326:40: parsing function body '__llvm_libc_21_0_0_git::cpp::LlvmLibcTypeTraitsTest_is_class::Run'
5.	/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/test/src/__support/CPP/type_traits_test.cpp:326:40: in compound statement ('{}')
6.	/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/__support/CPP/type_traits/is_class.h:27:32: instantiating variable definition '__llvm_libc_21_0_0_git::cpp::is_class_v<__llvm_libc_21_0_0_git::cpp::EnumClass>'
7.	/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/src/__support/CPP/type_traits/is_class.h:25:27: instantiating class definition '__llvm_libc_21_0_0_git::cpp::is_class<__llvm_libc_21_0_0_git::cpp::EnumClass>'
  #0 0x000055c0dbb3ec9f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x2ad6c9f)
  #1 0x000055c0dbb3c794 llvm::sys::CleanupOnSignal(unsigned long) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x2ad4794)
  #2 0x000055c0dba7bfd8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
  #3 0x00007f0910783420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
  #4 0x00007f091025000b raise /build/glibc-FcRMwW/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
  #5 0x00007f091022f859 abort /build/glibc-FcRMwW/glibc-2.31/stdlib/abort.c:81:7
  #6 0x00007f091022f729 get_sysdep_segment_value /build/glibc-FcRMwW/glibc-2.31/intl/loadmsgcat.c:509:8
  #7 0x00007f091022f729 _nl_load_domain /build/glibc-FcRMwW/glibc-2.31/intl/loadmsgcat.c:970:34
  #8 0x00007f0910240fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
  #9 0x000055c0debdc396 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x5b74396)
 #10 0x000055c0debdc499 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x5b74499)
 #11 0x000055c0de472771 clang::Sema::GatherArgumentsForCall(clang::SourceLocation, clang::FunctionDecl*, clang::FunctionProtoType const*, unsigned int, llvm::ArrayRef<clang::Expr*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::Sema::VariadicCallType, bool, bool) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x540a771)
 #12 0x000055c0de473b16 clang::Sema::ConvertArgumentsForCall(clang::CallExpr*, clang::Expr*, clang::FunctionDecl*, clang::FunctionProtoType const*, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, bool) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x540bb16)
 #13 0x000055c0de475501 clang::Sema::BuildResolvedCallExpr(clang::Expr*, clang::NamedDecl*, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, clang::CallExpr::ADLCallKind) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x540d501)
 #14 0x000055c0de880ea8 FinishOverloadedCallExpr(clang::Sema&, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #15 0x000055c0de881d69 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x5819d69)
 #16 0x000055c0de4770e7 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x540f0e7)
 #17 0x000055c0de477fdb clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x540ffdb)
 #18 0x000055c0deb129d8 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #19 0x000055c0deafdda5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #20 0x000055c0deaf4bef clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #21 0x000055c0deaf9bef clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
 #22 0x000055c0deb1ecfa clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x5ab6cfa)
 #23 0x000055c0deb1f247 clang::Sema::SubstBaseSpecifiers(clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x5ab7247)
 #24 0x000055c0deb1fc70 clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x5ab7c70)
 #25 0x000055c0deb525a0 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool, bool) (/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang+++0x5aea5a0)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 20, 2025

LLVM Buildbot has detected a new failure on builder cross-project-tests-sie-ubuntu running on doug-worker-1a while building clang-tools-extra,clang at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/181/builds/15922

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
1449.095 [185/8/763] Building CXX object tools/lldb/source/Plugins/Platform/AIX/CMakeFiles/lldbPluginPlatformAIX.dir/PlatformAIX.cpp.o
1456.551 [184/8/764] Building CXX object tools/lldb/source/Plugins/Platform/FreeBSD/CMakeFiles/lldbPluginPlatformFreeBSD.dir/PlatformFreeBSD.cpp.o
1456.655 [183/8/765] Building CXX object tools/lldb/source/Plugins/Platform/Android/CMakeFiles/lldbPluginPlatformAndroid.dir/PlatformAndroid.cpp.o
1457.988 [182/8/766] Building CXX object tools/lldb/source/Plugins/Platform/Linux/CMakeFiles/lldbPluginPlatformLinux.dir/PlatformLinux.cpp.o
1458.318 [181/8/767] Building CXX object tools/lldb/source/Plugins/Platform/NetBSD/CMakeFiles/lldbPluginPlatformNetBSD.dir/PlatformNetBSD.cpp.o
1460.250 [180/8/768] Building CXX object tools/lldb/source/Plugins/Platform/POSIX/CMakeFiles/lldbPluginPlatformPOSIX.dir/PlatformPOSIX.cpp.o
1461.932 [179/8/769] Building CXX object tools/lldb/source/Plugins/Platform/Windows/CMakeFiles/lldbPluginPlatformWindows.dir/PlatformWindows.cpp.o
1461.970 [178/8/770] Building CXX object tools/lldb/source/Plugins/RegisterTypeBuilder/CMakeFiles/lldbPluginRegisterTypeBuilderClang.dir/RegisterTypeBuilderClang.cpp.o
1465.175 [177/8/771] Building CXX object tools/lldb/source/Plugins/SymbolFile/CTF/CMakeFiles/lldbPluginSymbolFileCTF.dir/SymbolFileCTF.cpp.o
1475.718 [176/8/772] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o
FAILED: tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o 
/opt/ccache/bin/g++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/source/Plugins/SymbolFile/NativePDB -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/include -I/usr/include/python3.8 -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-stringop-truncation -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -MF tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o.d -o tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -c /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp: In member function ‘clang::QualType lldb_private::npdb::PdbAstBuilder::CreatePointerType(const llvm::codeview::PointerRecord&)’:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:565:46: error: no matching function for call to ‘clang::ASTContext::getMemberPointerType(clang::QualType&, const clang::Type*)’
  565 |         pointee_type, class_type.getTypePtr());
      |                                              ^
In file included from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h:17,
                 from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h:16,
                 from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:1:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../clang/include/clang/AST/ASTContext.h:1562:12: note: candidate: ‘clang::QualType clang::ASTContext::getMemberPointerType(clang::QualType, clang::NestedNameSpecifier*, const clang::CXXRecordDecl*) const’
 1562 |   QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
      |            ^~~~~~~~~~~~~~~~~~~~
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../clang/include/clang/AST/ASTContext.h:1562:12: note:   candidate expects 3 arguments, 2 provided
1477.194 [176/7/773] Building CXX object tools/lldb/source/Plugins/SystemRuntime/MacOSX/CMakeFiles/lldbPluginSystemRuntimeMacOSX.dir/AppleGetItemInfoHandler.cpp.o
1479.562 [176/6/774] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/UdtRecordCompleter.cpp.o
1482.304 [176/5/775] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/PDBASTParser.cpp.o
1483.089 [176/4/776] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/SymbolFilePDB.cpp.o
1483.174 [176/3/777] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/DWARFASTParserClang.cpp.o
1483.306 [176/2/778] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/SymbolFileNativePDB.cpp.o
1484.045 [176/1/779] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/SymbolFileDWARF.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 20, 2025

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building clang-tools-extra,clang at step 4 "build".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/14624

Here is the relevant piece of the build log for the reference
Step 4 (build) failure: build (failure)
...
1529.788 [913/10/5628] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbSymUid.cpp.o
1529.793 [912/10/5629] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbIndex.cpp.o
1529.796 [911/10/5630] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbUtil.cpp.o
1529.834 [910/10/5631] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/PDBLocationToDWARFExpression.cpp.o
1529.897 [910/9/5632] Building CXX object tools/lldb/source/Plugins/SymbolFile/Symtab/CMakeFiles/lldbPluginSymbolFileSymtab.dir/SymbolFileSymtab.cpp.o
1531.901 [910/8/5633] Building CXX object tools/lldb/source/Plugins/SymbolFile/CTF/CMakeFiles/lldbPluginSymbolFileCTF.dir/SymbolFileCTF.cpp.o
1537.136 [909/8/5634] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/DWARFASTParserClang.cpp.o
1538.621 [909/7/5635] Building CXX object tools/lldb/source/Plugins/SystemRuntime/MacOSX/CMakeFiles/lldbPluginSystemRuntimeMacOSX.dir/AppleGetItemInfoHandler.cpp.o
1539.276 [909/6/5636] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/SymbolFileDWARF.cpp.o
1539.510 [909/5/5637] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o
FAILED: tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o 
/usr/local/bin/c++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/source/Plugins/SymbolFile/NativePDB -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/llvm/include -I/usr/include/python3.10 -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/llvm/../clang/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/../clang/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/source -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -MF tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o.d -o tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -c /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
../llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:565:46: error: too few arguments to function call, expected 3, have 2
  564 |     return m_clang.getASTContext().getMemberPointerType(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  565 |         pointee_type, class_type.getTypePtr());
      |                                              ^
../llvm-project/clang/include/clang/AST/ASTContext.h:1562:12: note: 'getMemberPointerType' declared here
 1562 |   QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
      |            ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1563 |                                 const CXXRecordDecl *Cls) const;
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
1541.391 [909/4/5638] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/PDBASTParser.cpp.o
1541.600 [909/3/5639] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/UdtRecordCompleter.cpp.o
1542.783 [909/2/5640] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/SymbolFilePDB.cpp.o
1544.703 [909/1/5641] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/SymbolFileNativePDB.cpp.o
ninja: build stopped: subcommand failed.

@mizvekov
Copy link
Contributor Author

Oof, looks like lldb needs updating too.

mizvekov added a commit that referenced this pull request Mar 20, 2025
…members" (#132215)

Reverts #130537

This missed updating lldb, which we didn't notice due to lack of
pre-commit CI.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 20, 2025

LLVM Buildbot has detected a new failure on builder cross-project-tests-sie-ubuntu-dwarf5 running on doug-worker-1b while building clang-tools-extra,clang at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/163/builds/15578

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
2253.360 [185/8/763] Building CXX object tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeFiles/lldbPluginAppleObjCRuntime.dir/AppleObjCRuntimeV2.cpp.o
2263.928 [184/8/764] Building CXX object tools/lldb/source/Plugins/Platform/FreeBSD/CMakeFiles/lldbPluginPlatformFreeBSD.dir/PlatformFreeBSD.cpp.o
2265.148 [183/8/765] Building CXX object tools/lldb/source/Plugins/Platform/Android/CMakeFiles/lldbPluginPlatformAndroid.dir/PlatformAndroid.cpp.o
2267.019 [182/8/766] Building CXX object tools/lldb/source/Plugins/Platform/Linux/CMakeFiles/lldbPluginPlatformLinux.dir/PlatformLinux.cpp.o
2267.539 [181/8/767] Building CXX object tools/lldb/source/Plugins/Platform/NetBSD/CMakeFiles/lldbPluginPlatformNetBSD.dir/PlatformNetBSD.cpp.o
2270.817 [180/8/768] Building CXX object tools/lldb/source/Plugins/Platform/POSIX/CMakeFiles/lldbPluginPlatformPOSIX.dir/PlatformPOSIX.cpp.o
2272.785 [179/8/769] Building CXX object tools/lldb/source/Plugins/Platform/Windows/CMakeFiles/lldbPluginPlatformWindows.dir/PlatformWindows.cpp.o
2273.207 [178/8/770] Building CXX object tools/lldb/source/Plugins/RegisterTypeBuilder/CMakeFiles/lldbPluginRegisterTypeBuilderClang.dir/RegisterTypeBuilderClang.cpp.o
2277.918 [177/8/771] Building CXX object tools/lldb/source/Plugins/SymbolFile/CTF/CMakeFiles/lldbPluginSymbolFileCTF.dir/SymbolFileCTF.cpp.o
2293.897 [176/8/772] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o
FAILED: tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o 
/opt/ccache/bin/g++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/source/Plugins/SymbolFile/NativePDB -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/llvm/include -I/usr/include/python3.10 -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/llvm/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/source -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-stringop-truncation -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -MF tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o.d -o tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -c /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp: In member function ‘clang::QualType lldb_private::npdb::PdbAstBuilder::CreatePointerType(const llvm::codeview::PointerRecord&)’:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:564:56: error: no matching function for call to ‘clang::ASTContext::getMemberPointerType(clang::QualType&, const clang::Type*)’
  564 |     return m_clang.getASTContext().getMemberPointerType(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  565 |         pointee_type, class_type.getTypePtr());
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          
In file included from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h:17,
                 from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h:16,
                 from /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:1:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/llvm/../clang/include/clang/AST/ASTContext.h:1562:12: note: candidate: ‘clang::QualType clang::ASTContext::getMemberPointerType(clang::QualType, clang::NestedNameSpecifier*, const clang::CXXRecordDecl*) const’
 1562 |   QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
      |            ^~~~~~~~~~~~~~~~~~~~
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/llvm/../clang/include/clang/AST/ASTContext.h:1562:12: note:   candidate expects 3 arguments, 2 provided
2296.743 [176/7/773] Building CXX object tools/lldb/source/Plugins/SystemRuntime/MacOSX/CMakeFiles/lldbPluginSystemRuntimeMacOSX.dir/AppleGetItemInfoHandler.cpp.o
2301.058 [176/6/774] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/PDBASTParser.cpp.o
2302.455 [176/5/775] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/UdtRecordCompleter.cpp.o
2303.123 [176/4/776] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/DWARFASTParserClang.cpp.o
2305.140 [176/3/777] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/SymbolFileNativePDB.cpp.o
2307.091 [176/2/778] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/SymbolFileDWARF.cpp.o
2307.365 [176/1/779] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/SymbolFilePDB.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 20, 2025

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building clang-tools-extra,clang at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/22602

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
535.832 [118/25/7079] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangPersistentVariables.cpp.o
536.438 [118/24/7080] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/NameSearchContext.cpp.o
536.569 [118/23/7081] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ASTStructExtractor.cpp.o
536.917 [118/22/7082] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/CxxModuleHandler.cpp.o
537.347 [118/21/7083] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangUtilityFunction.cpp.o
537.655 [118/20/7084] Building CXX object tools/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeFiles/lldbPluginAppleObjCRuntime.dir/AppleObjCRuntimeV2.cpp.o
539.190 [118/19/7085] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangFunctionCaller.cpp.o
539.233 [118/18/7086] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangUserExpression.cpp.o
539.260 [118/17/7087] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ASTResultSynthesizer.cpp.o
539.765 [118/16/7088] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o
FAILED: tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source/Plugins/SymbolFile/NativePDB -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/../clang/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/../clang/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -MF tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o.d -o tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/PdbAstBuilder.cpp.o -c /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:565:46: error: too few arguments to function call, expected 3, have 2
        pointee_type, class_type.getTypePtr());
                                             ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/../clang/include/clang/AST/ASTContext.h:1562:12: note: 'getMemberPointerType' declared here
  QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
           ^
1 error generated.
539.996 [118/15/7089] Building CXX object tools/lldb/source/Plugins/SymbolFile/CTF/CMakeFiles/lldbPluginSymbolFileCTF.dir/SymbolFileCTF.cpp.o
542.832 [118/14/7090] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangASTSource.cpp.o
543.042 [118/13/7091] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangASTImporter.cpp.o
543.858 [118/12/7092] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/IRForTarget.cpp.o
544.785 [118/11/7093] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/UdtRecordCompleter.cpp.o
545.026 [118/10/7094] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangModulesDeclVendor.cpp.o
545.530 [118/9/7095] Building CXX object tools/lldb/source/Commands/CMakeFiles/lldbCommands.dir/CommandObjectTarget.cpp.o
545.537 [118/8/7096] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/PDBASTParser.cpp.o
545.882 [118/7/7097] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangExpressionDeclMap.cpp.o
547.420 [118/6/7098] Building CXX object tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o
FAILED: tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source/Plugins/TypeSystem/Clang -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/TypeSystem/Clang -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/../clang/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/../clang/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o -MF tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o.d -o tools/lldb/source/Plugins/TypeSystem/Clang/CMakeFiles/lldbPluginTypeSystemClang.dir/TypeSystemClang.cpp.o -c /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:2775:16: error: no member named 'getClass' in 'clang::MemberPointerType'
      if (MPT->getClass()->isRecordType())
          ~~~  ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:2776:57: error: no member named 'getClass' in 'clang::MemberPointerType'
        GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
                                                   ~~~  ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:8614:50: error: too few arguments to function call, expected 3, have 2
        ClangUtil::GetQualType(type).getTypePtr()));
                                                 ^
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/../clang/include/clang/AST/ASTContext.h:1562:12: note: 'getMemberPointerType' declared here
  QualType getMemberPointerType(QualType T, NestedNameSpecifier *Qualifier,
           ^
3 errors generated.
547.843 [118/5/7099] Building CXX object tools/lldb/source/Plugins/SymbolFile/PDB/CMakeFiles/lldbPluginSymbolFilePDB.dir/SymbolFilePDB.cpp.o
550.581 [118/4/7100] Building CXX object tools/lldb/source/Plugins/ExpressionParser/Clang/CMakeFiles/lldbPluginExpressionParserClang.dir/ClangExpressionParser.cpp.o
551.573 [118/3/7101] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/DWARFASTParserClang.cpp.o
553.827 [118/2/7102] Building CXX object tools/lldb/source/Plugins/SymbolFile/NativePDB/CMakeFiles/lldbPluginSymbolFileNativePDB.dir/SymbolFileNativePDB.cpp.o
555.616 [118/1/7103] Building CXX object tools/lldb/source/Plugins/SymbolFile/DWARF/CMakeFiles/lldbPluginSymbolFileDWARF.dir/SymbolFileDWARF.cpp.o

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 20, 2025
…ointers to members" (#132215)

Reverts llvm/llvm-project#130537

This missed updating lldb, which we didn't notice due to lack of
pre-commit CI.
mizvekov added a commit that referenced this pull request Mar 20, 2025
Original PR: #130537
Reland after updating lldb too.

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.
mizvekov added a commit that referenced this pull request Mar 20, 2025
…er (#132234)

Original PR: #130537
Reland after updating lldb too.

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.
mizvekov added a commit that referenced this pull request Mar 21, 2025
Original PR: #130537
Originally reverted due to revert of dependent commit.
Relanding with no changes.

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.
mizvekov added a commit that referenced this pull request Mar 21, 2025
…er (#132401)

Original PR: #130537
Originally reverted due to revert of dependent commit. Relanding with no
changes.

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.
mizvekov added a commit that referenced this pull request Mar 26, 2025
This fixes a regression when interpreting a nested name specifier
for deduction purposes in member pointers.

This introduces a helper for fully translating a nested name specifier into a
type.

Other existing potential users will be deduplicated by using this helper
in subsequent patches.

This regression was introduced here: #130537
and was reported here: #132401 (comment)

No release notes, since the regression was never released.
mizvekov added a commit that referenced this pull request Mar 26, 2025
This fixes a regression when interpreting a nested name specifier
for deduction purposes in member pointers.

This introduces a helper for fully translating a nested name specifier into a
type.

Other existing potential users will be deduplicated by using this helper
in subsequent patches.

This regression was introduced here: #130537
and was reported here: #132401 (comment)

No release notes, since the regression was never released.
mizvekov added a commit that referenced this pull request Mar 26, 2025
This fixes a regression when interpreting a nested name specifier
for deduction purposes in member pointers.

This introduces a helper for fully translating a nested name specifier into a
type.

Other existing potential users will be deduplicated by using this helper
in subsequent patches.

This regression was introduced here: #130537
and was reported here: #132401 (comment)

No release notes, since the regression was never released.
mizvekov added a commit that referenced this pull request Mar 26, 2025
This fixes a regression when interpreting a nested name specifier
for deduction purposes in member pointers.

This introduces a helper for fully translating a nested name specifier into a
type.

This regression was introduced here: #130537
and was reported here: #132401 (comment)

No release notes, since the regression was never released.
mizvekov added a commit that referenced this pull request Mar 26, 2025
…#133113)

This fixes a regression when interpreting a nested name specifier for
deduction purposes in member pointers.

This introduces a helper for fully translating a nested name specifier
into a type.

This regression was introduced here:
#130537
and was reported here:
#132401 (comment)

No release notes, since this regression was never released.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 26, 2025
…med classes (#133113)

This fixes a regression when interpreting a nested name specifier for
deduction purposes in member pointers.

This introduces a helper for fully translating a nested name specifier
into a type.

This regression was introduced here:
llvm/llvm-project#130537
and was reported here:
llvm/llvm-project#132401 (comment)

No release notes, since this regression was never released.
mizvekov added a commit that referenced this pull request Mar 27, 2025
Fixes a regression introduced in #130537
and reported here #133144

This fixes a crash in ASTStructuralEquivalence where
the non-null precondition for IsStructurallyEquivalent
would be violated, when comparing member pointers with a dependent
class.

This also drive-by fixes the ast node traverser for member pointers
so it doesn't traverse into the qualifier in case it's not a type,
or the class declaration in case there is none.

This avoids printing of `<<<NULL>>>` on the text node dumper,
which is redundant.

No release notes since the regression was never released.

Fixes #133144
mizvekov added a commit that referenced this pull request Mar 28, 2025
…133343)

Fixes a regression introduced in
#130537 and reported here
#133144

This fixes a crash in ASTStructuralEquivalence where the non-null
precondition for IsStructurallyEquivalent would be violated, when
comparing member pointers with a dependent class.

This also drive-by fixes the ast node traverser for member pointers so
it doesn't traverse into the qualifier in case it's not a type, or the
class declaration in case it would be equivalent to what the qualifier
refers.

This avoids printing of `<<<NULL>>>` on the text node dumper, which is
redundant.

No release notes since the regression was never released.

Fixes #133144
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 28, 2025
…er pointer (#133343)

Fixes a regression introduced in
llvm/llvm-project#130537 and reported here
llvm/llvm-project#133144

This fixes a crash in ASTStructuralEquivalence where the non-null
precondition for IsStructurallyEquivalent would be violated, when
comparing member pointers with a dependent class.

This also drive-by fixes the ast node traverser for member pointers so
it doesn't traverse into the qualifier in case it's not a type, or the
class declaration in case it would be equivalent to what the qualifier
refers.

This avoids printing of `<<<NULL>>>` on the text node dumper, which is
redundant.

No release notes since the regression was never released.

Fixes llvm/llvm-project#133144
mizvekov added a commit that referenced this pull request Mar 30, 2025
This implements a missing case for an adjusted member-pointer
in getCommonSugaredType, when that was originally implemented
here: #130537

This missing case could otherwise cause a crash, so this is a
regression fix.

This should fix the crash reported here: #132401 (comment)

No release notes, since this regression and the underlying feature
were never released.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:as-a-library libclang and C++ API clang:codegen IR generation bugs: mangling, exceptions, etc. clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:openmp OpenMP related changes to Clang clang:static analyzer clang Clang issues not falling into any other category clang-tidy clang-tools-extra clangd debuginfo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants