Skip to content

Build error in sync_switch.cc on Clang-16 with GCC 14 stdlib. #150515

Closed

Description

@johnoneil

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]

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Jun 20, 2024
  2. huycozy commented on Jun 20, 2024

    @huycozy
    Member

    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 -v as 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)

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 20, 2024
  4. added 4 commits that reference this issue on Jun 27, 2024
    1d3eb2d
    1ad50f5
    8139da5
    f9af8ca
  5. added a commit that references this issue on Jun 28, 2024
    15f95ce
  6. added a commit that references this issue on Jul 8, 2024
    5e6be1e
  7. github-actions commented on Jul 12, 2024

    @github-actions

    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 -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions