Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cast of integers to pointers #1243

Merged
merged 1 commit into from
May 11, 2022
Merged

Allow cast of integers to pointers #1243

merged 1 commit into from
May 11, 2022

Conversation

philberty
Copy link
Member

This adds the cast rules of integer types and integer inference variables
to pointers. The code-generation needed to remove the bad assertion that
all integer literals were always going to be of type integer. This also
needed a tweak to a bad port from the cp/constexpr.cc code which assumed
that all integer_cst of pointer types would be a zero pointer which was
used to detect cases of bad method pointers in CPP which we does not apply
here.

see gcc/cp/constexpr.cc:6564-6488

Fixes #1226

@philberty philberty added the bug label May 10, 2022
@philberty philberty self-assigned this May 10, 2022
This adds the cast rules of integer types and integer inference variables
to pointers. The code-generation needed to remove the bad assertion that
all integer literals were always going to be of type integer. This also
needed a tweak to a bad port from the cp/constexpr.cc code which assumed
that all integer_cst of pointer types would be a zero pointer which was
used to detect cases of bad method pointers in CPP which we does not apply
here.

see gcc/cp/constexpr.cc:6564-6488

Fixes #1226
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Embedded people will be happy :)

@philberty
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented May 11, 2022

Build succeeded:

@bors bors bot merged commit f2aee09 into master May 11, 2022
@philberty philberty deleted the phil/ptr-cast branch May 11, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid cast to pointer should be allowed
2 participants