mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 13:50:11 +00:00
Fix comparison of Structural Values
Fixes a regression from #78041 as reported in the review. The original patch failed to compare the canonical type, which this adds. A slightly modified test of the original report is added. (cherry picked from commit e3ee3762304aa81e4a240500844bfdd003401b36)
This commit is contained in:
parent
2cf04c020f
commit
16bfe1e89f
@ -450,7 +450,8 @@ bool TemplateArgument::structurallyEquals(const TemplateArgument &Other) const {
|
||||
getAsIntegral() == Other.getAsIntegral();
|
||||
|
||||
case StructuralValue: {
|
||||
if (getStructuralValueType() != Other.getStructuralValueType())
|
||||
if (getStructuralValueType().getCanonicalType() !=
|
||||
Other.getStructuralValueType().getCanonicalType())
|
||||
return false;
|
||||
|
||||
llvm::FoldingSetNodeID A, B;
|
||||
|
@ -336,3 +336,21 @@ template<int ...Ns> void bar(B b) {
|
||||
(b.operator Tbar<Ns>(), ...);
|
||||
}
|
||||
}
|
||||
|
||||
namespace ReportedRegression1 {
|
||||
const char kt[] = "dummy";
|
||||
|
||||
template <class T, const char id[]>
|
||||
class SomeTempl { };
|
||||
|
||||
template <const char id[]>
|
||||
class SomeTempl<int, id> {
|
||||
public:
|
||||
int exit_code() const { return 0; }
|
||||
};
|
||||
|
||||
int use() {
|
||||
SomeTempl<int, kt> dummy;
|
||||
return dummy.exit_code();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user