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

Fix compiling idl_parser.cpp against certain STLs #8066

Merged
merged 3 commits into from Sep 29, 2023

Conversation

reshilkin
Copy link
Contributor

We use patched libc++ which uses raw pointers as std::string iterators.
Compiling flatbuffers against our libc++ results in the following ambiguous call:

flatbuffers/src/idl_parser.cpp:2103:16: error: call to member function 'insert' is ambiguous
    attribute_.insert(0, 1, sign);
    ~~~~~~~~~~~^~~~~~
libcxx/include/string:1153:19: note: candidate function
    basic_string& insert(size_type __pos, size_type __n, value_type __c);
                  ^
libcxx/include/string:1156:19: note: candidate function
    iterator      insert(const_iterator __pos, size_type __n, value_type __c);

This PR adds explicit casts to help the compiler.

@google-cla
Copy link

google-cla bot commented Aug 11, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Aug 11, 2023
@reshilkin
Copy link
Contributor Author

@dbaileychess Could you, please, take a look?

@dbaileychess dbaileychess merged commit 7f417e3 into google:master Sep 29, 2023
47 checks passed
candysonya pushed a commit to candysonya/flatbuffers that referenced this pull request Jan 8, 2024
Co-authored-by: Derek Bailey <derekbailey@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants