Skip to content

Commit 6cb942c

Browse files
[llvm] Remove argument_type in std::hash specializations (NFC) (#165167)
The argument_type and result_type type aliases in std::hash are deprecated in C++17 and removed in C++20. This patch aligns two specializations of ours with the C++ standard.
1 parent 50a37c0 commit 6cb942c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

llvm/include/llvm/DebugInfo/PDB/PDBTypes.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,7 @@ struct Variant {
600600
namespace std {
601601

602602
template <> struct hash<llvm::pdb::PDB_SymType> {
603-
using argument_type = llvm::pdb::PDB_SymType;
604-
using result_type = std::size_t;
605-
606-
result_type operator()(const argument_type &Arg) const {
603+
std::size_t operator()(const llvm::pdb::PDB_SymType &Arg) const {
607604
return std::hash<int>()(static_cast<int>(Arg));
608605
}
609606
};

llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ template <> struct llvm::DenseMapInfo<VariableID> {
8686
using VarLocInsertPt = PointerUnion<const Instruction *, const DbgRecord *>;
8787

8888
template <> struct std::hash<VarLocInsertPt> {
89-
using argument_type = VarLocInsertPt;
90-
using result_type = std::size_t;
91-
92-
result_type operator()(const argument_type &Arg) const {
89+
std::size_t operator()(const VarLocInsertPt &Arg) const {
9390
return std::hash<void *>()(Arg.getOpaqueValue());
9491
}
9592
};

0 commit comments

Comments
 (0)