Date
2022-02-18.07:47:23
Message id
5478

Content

The following example illustrates an incompatibility between C++11 and C++14:

  struct S {
    int m = 1;
  };        // C++11: S is non-aggregate
            // C++14: S is AGGREGATE
  struct X {
      operator int();
      operator S();
  };

  int main() {
    X a{};
    S b{a};  // C++11: valid, copy constr S(a.operator S()) is called here
             // C++14: valid, aggregate initialization { a.operator int() }

    printf("%d\n", b.m);
  }

This should be documented in Annex Clause Annex C [diff].