[PATCH] D92956: Fix https://bugs.llvm.org/show_bug.cgi?id=48011

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 11:36:57 PST 2020


Quuxplusone added inline comments.


================
Comment at: clang/test/SemaCXX/warn-range-loop-analysis.cpp:35
+  // operator.
+  ID1& operator=(ID1 const& other) { return *this; }
+};
----------------
I recommend adding `ID1(ID1 const&) = default;` here. My understanding is that C++20 has deprecated auto-generating a defaulted copy constructor for a class with a user-defined copy-assignment operator. See `-Wdeprecated-copy`.


================
Comment at: clang/test/SemaCXX/warn-range-loop-analysis.cpp:477
+  for (const ID1&x : C) {}
+  // No warning
+}
----------------
Isn't the point of https://bugs.llvm.org/show_bug.cgi?id=48011 that there should be no warning for `for (ID1 x : C) {}`?  There is already no warning for the `const&` case tested here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92956



More information about the cfe-commits mailing list