Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add support for C++20's char8_t type. #3074

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

Merged

Conversation

matt-gretton-dann
Copy link
Contributor

@matt-gretton-dann matt-gretton-dann commented Mar 16, 2020

Internal extractor PR: https://git.semmle.com/Semmle/code/pull/36459
GH issue: https://github.com/github/codeql-c-extractor-team/issues/50

This adds support for char8_t a new type supported by C++20. I have added basic support to the extractor and C++ QL libraries to treat it like char16_t

I have not attempted to write a complex upgrade script which converts non-builtin char8_t types to builtin ones because we run the risk of breaking databases where char8_t is not a builtin type (because they're not C++20).

@matt-gretton-dann matt-gretton-dann added C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR labels Mar 16, 2020
@matt-gretton-dann matt-gretton-dann requested a review from a team as a code owner March 16, 2020 15:06
@matt-gretton-dann
Copy link
Contributor Author

Language-Tests/CPP failures are those we expect to fail because this is using an extractor which doesn't support char8_t. See internal extractor PR which shows the tests passing.

igfoo
igfoo previously approved these changes Mar 17, 2020
Copy link
Contributor

@igfoo igfoo left a comment

Choose a reason for hiding this comment

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

LGTM

@jbj
Copy link
Contributor

jbj commented Mar 17, 2020

I git-grepped for Char16Type and \<43\> in this repo and found two more places where the support for Char16Type could be copied and adapted to support Char8Type as well: two occurrences in Padding.qll and one in integralTypeMapping in Type.qll.

@jbj
Copy link
Contributor

jbj commented Mar 17, 2020

Note that if you add a commit to this PR with the changes I suggested, you don't have to update the internal PR to bump the submodule. It should be fine to leave the submodule pointing at a commit that's not the head of this PR as long as the changes past that point aren't crucial to correctness.

@matt-gretton-dann
Copy link
Contributor Author

I git-grepped for Char16Type and \<43\> in this repo and found two more places where the support for Char16Type could be copied and adapted to support Char8Type as well: two occurrences in Padding.qll and one in integralTypeMapping in Type.qll.

7b0539c should cover these changes.

jbj
jbj previously approved these changes Mar 18, 2020
Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

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

LGTM!

@nickrolfe nickrolfe merged commit 55301b4 into github:master Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants