[PATCH] D87244: [clang] Add fix-it for -Wreorder-ctor.

Jeroen Van Antwerpen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 6 23:38:24 PST 2021


Jeroen added inline comments.


================
Comment at: clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp:171
+  // code can't do this.
+  Bar(int x) : c(x), /*foo*/ a(2), b(3) {} // expected-warning {{field 'c' will be initialized after field 'a'}}
+  // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]
----------------
What would be the behavior for `:c(x), b(3), a(2)`?
Does that get fixed in 1 go, or should this be done in 2 steps?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87244



More information about the cfe-commits mailing list