Repository navigation
Build error in sync_switch.cc on Clang-16 with GCC 14 stdlib. #150515
Copy link
Copy link
Closed
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
Steps to reproduce
This is reproducible on certain setups building with Clang++-16 using GCC 14 C++ stdlib backend.
For example:
clang++-16 -v
Debian clang version 16.0.6 (20)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/14
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/14
Candidate multilib: .;@m64
Selected multilib: .;@m64
Building in this configuration results in error:
/usr/bin/clang++-16 -DIMPELLER_DEBUG=1 -DIMPELLER_ENABLE_3D=1 -I/mnt/sda/code/display-safety/crates/impeller-rs/impeller-cmake -I/mnt/sda/code/display-safety/crates/impeller-rs/impeller-cmake/third_party/abseil-cpp -I/mnt/sda/code/display-safety/crates/impeller-rs/impeller-cmake/third_party -g -std=gnu++20 -MD -MT CMakeFiles/fml.dir/third_party/flutter/fml/synchronization/sync_switch.cc.o -MF CMakeFiles/fml.dir/third_party/flutter/fml/synchronization/sync_switch.cc.o.d -o CMakeFiles/fml.dir/third_party/flutter/fml/synchronization/sync_switch.cc.o -c /mnt/sda/code/display-safety/crates/impeller-rs/impeller-cmake/third_party/flutter/fml/synchronization/sync_switch.cc
/mnt/sda/code/display-safety/crates/impeller-rs/impeller-cmake/third_party/flutter/fml/synchronization/sync_switch.cc:48:7: error: no matching function for call to 'find'
if (std::find(observers_.begin(), observers_.end(), observer) ==
^~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate template ignored: could not match 'istreambuf_iterator' against '__normal_iterator'
find(istreambuf_iterator<_CharT> __first,
^
/mnt/sda/code/display-safety/crates/impeller-rs/impeller-cmake/third_party/flutter/fml/synchronization/sync_switch.cc:56:52: error: too many arguments to function call, expected single argument '__filename', have 3 arguments
observers_.erase(std::remove(observers_.begin(), observers_.end(), observer),
~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/stdio.h:152:12: note: 'remove' declared here
extern int remove (const char *__filename) __THROW;
^
2 errors generated.
As sync_switch.cc refers to functions defined in <algorithm> I think the header should be present on all platforms.
Expected results
Build should complete without error.
Actual results
Error quoted above.
Code sample
Code sample
[Paste your code here]Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[Paste your output here]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Activity
huycozy commentedon Jun 20, 2024
Hi @johnoneil
Can you share steps to reproduce the error?
clang++is used by default, I wonder how you build app with a specific clang version? Is there only one version on your system?What is your Flutter version? (please provide the output of
flutter doctor -v)And please provide the output of
flutter run -vas well, thanks! (If the log is too large to be uploaded to GitHub, you may upload it as a txt file or use online tools like https://pastebin.com/ to share it)4dd4f54 Fix flutter#150515 Provide required headers for build with Cl…
4dd4f54 Fix flutter#150515 Provide required headers for build with Cl…
4dd4f54 Fix flutter#150515 Provide required headers for build with Cl…
4dd4f54 Fix flutter#150515 Provide required headers for build with Cl…
Roll Flutter Engine from ddd4814 to 94591ff (5 revisions) (#150968)
Roll Flutter Engine from ddd4814 to 94591ff (5 revisions) (flutter#15…
github-actions commentedon Jul 12, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.