Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Ignore qualifiers when hashing aro.QualType #233

Merged
Vexu merged 2 commits into
ziglang:mainfrom
zml:steeve/issue-228
Nov 23, 2025
Merged

Ignore qualifiers when hashing aro.QualType #233
Vexu merged 2 commits into
ziglang:mainfrom
zml:steeve/issue-228

Conversation

@steeve
Copy link
Copy Markdown
Contributor

@steeve steeve commented Nov 20, 2025

Closes #228

@Vexu
Copy link
Copy Markdown
Member

Vexu commented Nov 20, 2025

That diff was not intended as a complete fix as it does not address all the sites where anonymous_record_field_names is used. A good fix would be to make the hash map use a custom context which ignores the qualifiers when hashing. This same issue also applies to all other hashmaps keyed on QualTypes which is why foo is not detected as a member function but bar is:

struct Foo {
    int a;
};
extern int foo(const struct Foo *);
extern int bar(struct Foo *);

@steeve steeve changed the title Handle member access in struct with union as const arg Ignore qualifiers when hashing aro.QualType Nov 22, 2025
@steeve
Copy link
Copy Markdown
Contributor Author

steeve commented Nov 22, 2025

Updated. Not sure about if this is how you'd like it shape for the code, but it works.

Comment thread src/Scope.zig Outdated
@Vexu Vexu enabled auto-merge (squash) November 22, 2025 23:34
@Vexu Vexu merged commit a369b97 into ziglang:main Nov 23, 2025
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

member access in struct with union as const argument failure

2 participants