| Issue |
160684
|
| Summary |
[CodeGen] `std::less<llvm::rdf::RegisterRef>` and `std::equal_to<llvm::rdf::RegisterRef>` full specializations don't satisfy the standard requirements
|
| Labels |
llvm:codegen,
code-quality
|
| Assignees |
|
| Reporter |
frederick-vs-ja
|
The following full specializations don't satisfy [[namespace.std]/5.2](https://eel.is/c++draft/namespace.std#5.2).
> 5. A program may explicitly instantiate a class template defined in the standard library only if the declaration
> - (5.1) depends on the name of at least one program-defined type, and
> - (5.2) the instantiation meets the standard library requirements for the original template.
https://github.com/llvm/llvm-project/blob/c1f8dbb11cff9e017e3d65c22162e11d04a61dfa/llvm/include/llvm/CodeGen/RDFRegisters.h#L337-L347
https://github.com/llvm/llvm-project/blob/c1f8dbb11cff9e017e3d65c22162e11d04a61dfa/llvm/include/llvm/CodeGen/RDFRegisters.h#L356-L367
These full specializations violate the requirements by being non-default-constructible, and arguably, being non-empty/stateful.
Perhaps it's better to specify non-`std` comparators rather than simply use `std::set<RegisterRef>` or `std::map<RegisterRef, T>`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs