-
Notifications
You must be signed in to change notification settings - Fork 700
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't generate wrong strings. (#2487)
A header with ```cpp #include <stddef.h> const char S1[] = "Hello"; const unsigned char S2[] = u8"Hello"; const char16_t S3[] = u"Hello"; const char32_t S4[] = U"Hello"; const wchar_t S5[] = L"Hello"; ``` will wrongly generate (`-- -std=c++11`) ```rust pub const S1: &[u8; 6usize] = b"Hello\0"; pub const S2: &[u8; 6usize] = b"Hello\0"; pub const S3: &[u8; 2usize] = b"H\0"; pub const S4: &[u8; 2usize] = b"H\0"; pub const S5: &[u8; 2usize] = b"H\0"; ``` since `clang_EvalResult_getAsStr` only works for ordinary and UTF-8 strings. This seems like a `libclang` limitation since there isn't a similar function for other string literal types. This disables generating code for unsupported string types.
- Loading branch information
1 parent
f03d4f4
commit dcc21c1
Showing
2 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters