Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55257

IDL generates non-compiling comparison operations with inline_chained_structs:true

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • IDL
    • Service Arch
    • ALL
    • 4

    Description

      It appears that specifying {inline_chained_structs: true} leads the generated comparison operators to attempt to directly compare the member variables which exist on the chained struct despite them being on a different type.

      structs:
          One:
              description: ""
              generate_comparison_operators: true
              fields:
                  one: int
       
          Two:
              description: ""
              inline_chained_structs: true
              chained_structs:
                  One: OneStruct
              generate_comparison_operators: true
              fields:
                  two: int
      

      class Two {
      public:
      ...
          friend bool operator==(const Two& left, const Two& right) {
              return left._oneStruct == right._oneStruct && left._one == right._one && left._two == right._two;
          }
      ...
      private:
          mongo::One _oneStruct;
          std::int32_t _two;
          bool _hasTwo : 1;
      };
      

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: