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

self-comparison always evaluates to true in generated code with fluent style #7827

Open
IronFractal opened this issue Mar 9, 2025 · 0 comments
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) bug Something isn't working need triaging Issue that the owner of the area still need to triage

Comments

@IronFractal
Copy link

Bug Description

When compiling generated code specifically with the fluent style -DSLINT_STYLE="fluent-dark" results in numerous "self-comparison always evaluates to true [-Werror,-Wtautological-compare]" errors

/home/<user>/git/<project>/build/dev-clang/slint_generated_<project>_window_1.cpp:732:450: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare]
  732 |                             return slint::Brush([&]() -> slint::Color { if ([&]{ auto tmp_FluentPalette_84_color_scheme = self->globals->global_FluentPalette_84->color_scheme.get();;return [&]() -> bool { if (! (tmp_FluentPalette_84_color_scheme == slint::cbindgen_private::ColorScheme::Unknown)) { return (tmp_FluentPalette_84_color_scheme == slint::cbindgen_private::ColorScheme::Dark); } else { return (slint::cbindgen_private::ColorScheme::Dark == slint::cbindgen_private::ColorScheme::Dark); }}(); }()) { return slint::Color::from_argb_encoded(+3.003121664e9); } else { return slint::Color::from_argb_encoded(+4.294967295e9); }}());
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^

Reproducible Code (if applicable)

Environment Details

  • Slint Version: 1.10.0
  • Platform/OS: Pop!_OS 22.04 LTS
  • Programming Language: c++
  • Backend/Renderer:

Product Impact

No response

@IronFractal IronFractal added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Mar 9, 2025
@ogoffart ogoffart added the a:language-c++ C++ API, codegen, CMake build system (mS,mO) label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) bug Something isn't working need triaging Issue that the owner of the area still need to triage
Projects
None yet
Development

No branches or pull requests

2 participants