[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 8 07:07:04 PDT 2020


riccibruno added a comment.

@rsmith I have modified this patch to address your comment above (we should track where default argument(s) and/or default member initializer(s) were used). You accepted this originally but I would like to make sure that you are happy with the updated patch.

I was also confused for a while about the example:

  int a;
  struct S { int b = ++a; };
  void Test() {
    int c = S{}.b + a; // Warn in C++14 and above, but not before.
  }

I *think* that this should warn in C++14 and above, because `S` is an aggregate in C++14 and above, and the default member initializers of an aggregate are also part of the full-expression containing the initialization of the aggregate (`[intro.execution]p12`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81003/new/

https://reviews.llvm.org/D81003





More information about the cfe-commits mailing list