================
@@ -83,7 +83,17 @@ ComparisonCategoryInfo::ValueInfo 
*ComparisonCategoryInfo::lookupValueInfo(
       &Ctx.Idents.get(ComparisonCategories::getResultString(ValueKind)));
   if (Lookup.empty() || !isa<VarDecl>(Lookup.front()))
     return nullptr;
-  Objects.emplace_back(ValueKind, cast<VarDecl>(Lookup.front()));
+  // The static member must have the same type as the comparison category class
+  // itself (e.g., std::partial_ordering::less must be of type
+  // partial_ordering).
+  VarDecl *ValueDecl = cast<VarDecl>(Lookup.front());
+  const CXXRecordDecl *ValueDeclRecord =
+      ValueDecl->getType()->getAsCXXRecordDecl();
----------------
zwuis wrote:

`ValueDecl` is already a class name. It would be nice to rename these variables.

https://github.com/llvm/llvm-project/pull/172001
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to