ID 336043 - Not-equal-to operators (`!=`) of `FnAttribute::StringAttribute` are not marked as `const`

Follow

Problem summary:

The FnAttribute::StringAttribute class is defined with equal-to and not-equal-to operators, but only the equal-to operators are marked as const.

Steps to reproduce:

  1. Try to compile the following in a custom Op type plug-in:

void foo(const FnAttribute::StringAttribute& sa) {    if (sa == "bar") {        // compiles    }    if (sa != "baz") {        // doesn't compile    }}

Expected behaviour:

Compilation succeeds. The code runs fine.

Actual behaviour:

Compilation fails with an error message similar to the following:


error: passing 'const Foundry::Katana::StringAttribute' as 'this' argument of 'bool Foundry::Katana::StringAttribute::operator!=(const char*)' discards qualifiers [-fpermissive]     if (sa != "baz") {               ^

Workaround:

No known workaround.

Reproduced versions/platforms:

  • Katana 2.6v3/Linux
  • Katana 3.0v1.010012b/Linux

Customer version/platform:

Not supplied

    We're sorry to hear that

    Please tell us why