Menu

#633 C++20 compilation errors

unspecified
wont-fix
nobody
None
1
2025-12-03
2025-12-02
No

I am migrating my codebase to C++20 via the -std:c++20 flag to MSVC. This gives the following compilation error in OWLNext 7.0.19:

  • [source/owlcore/dib.cpp(343)]
    error C2666: 'owl::TColor::operator ==': overloaded functions have similar conversions
    • [include/owl/color.h(629)]
      note: could be 'bool owl::TColor::operator ==(const owl::TColor &) const'
    • [include/owl/color.h(829)]
      note: or 'bool owl::TRgbQuad::operator ==(COLORREF) const' [synthesized expression 'y == x']
    • [source/owlcore/dib.cpp(343)]
      note: while trying to match the argument list '(const owl::TColor, owl::TRgbQuad)'

I can sort of work around it by commenting out some of these operators, but that's clearly not the right solution.

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2025-12-03
    • status: open --> wont-fix
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2025-12-03

    Hi Andrew,

    Version 7 is based on C++17.

    But the trunk has already transitioned to C++20.

    See Roadmap | Version 8.

     

    Last edit: Vidar Hasfjord 2025-12-03
  • Vidar Hasfjord

    Vidar Hasfjord - 2025-12-03
    • Description has changed: [formatting]
     

    Last edit: Vidar Hasfjord 2025-12-03
    • Andrew Kirmse

      Andrew Kirmse - 2025-12-03

      @vattila wrote:

      The way to deal with an error like this is to homogenise the arguments to
      the comparison operator.

      Thanks, yes, that's what I ultimately did.


      Moderator: Removed superfluous quoted content.

       
      👍
      1

      Last edit: Vidar Hasfjord 2025-12-03

Log in to post a comment.