1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/unittests/ADT
Roman Lebedev f69ee08c94 [unittests] ADT: silence -Wself-assign diagnostics
Summary:
D44883 extends -Wself-assign to also work on C++ classes.
In it's current state (as suggested by @rjmccall), it is not under it's own sub-group.
Since that diag is enabled by `-Wall`, stage2 testing showed that:
* It does not fire on any llvm code
* It does fire for these 3 unittests
* It does fire for libc++ tests

This diff simply silences those new warnings in llvm's unittests.
A similar diff will be needed for libcxx. (`libcxx/test/std/language.support/support.types/byteops/`, maybe something else)

Since i don't think we want to repeat rL322901, let's talk about it.
I've subscribed everyone who i think might be interested...

There are several ways forward:
* Not extend -Wself-assign, close D44883. Not very productive outcome i'd say.
* Keep D44883 in it's current state.
  Unless your custom overloaded operators do something unusual for when self-assigning,
  the warning is no less of a false-positive than the current -Wself-assign.
  Except for tests of course, there you'd want to silence it. The current suggestion is:
  ```
  S a;
  a = (S &)a;
  ```
* Split the diagnostic in two - `-Wself-assign-builtin` (i.e. what is `-Wself-assign` in trunk),
  and `-Wself-assign-overloaded` - the new part in D44883.
  Since, as i said, i'm not really sure why it would be less of a error than the current `-Wself-assign`,
  both would still be in `-Wall`. That way one could simply pass `-Wno-self-assign-overloaded` for all the tests.
  Pretty simple to do, and will surely work.
* Split the diagnostic in two - `-Wself-assign-trivial`, and `-Wself-assign-nontrivial`.
  The choice of which diag to emit would depend on trivial-ness of that particular operator.
  The current `-Wself-assign` would be `-Wself-assign-trivial`.
  https://godbolt.org/g/gwDASe - `A`, `B` and `C` case would be treated as trivial, and `D`, `E` and `F` as non-trivial.
  Will be the most complicated to implement.

Thoughts?

Reviewers: aaron.ballman, rsmith, rtrieu, rjmccall, dblaikie, atrick, gottesmm

Reviewed By: dblaikie

Subscribers: lebedev.ri, phosek, vsk, rnk, thakis, sammccall, mclow.lists, llvm-commits, rjmccall

Differential Revision: https://reviews.llvm.org/D45082

llvm-svn: 329491
2018-04-07 10:37:18 +00:00
..
APFloatTest.cpp Fix APFloat from string conversion for Inf 2017-12-19 04:27:39 +00:00
APIntTest.cpp [APInt] Fix extractBits to correctly handle Result.isSingleWord() case. 2018-02-16 01:44:36 +00:00
APSIntTest.cpp
ArrayRefTest.cpp Fix incorrect usage of std::is_assignable. 2018-02-02 22:29:54 +00:00
BitmaskEnumTest.cpp
BitVectorTest.cpp [BitVector] Add find_[first,last]_[set,unset]_in. 2017-05-17 15:49:45 +00:00
BreadthFirstIteratorTest.cpp
BumpPtrListTest.cpp
CMakeLists.txt Re-commit: Make STATISTIC() values available programmatically 2018-03-05 19:38:16 +00:00
DAGDeltaAlgorithmTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
DeltaAlgorithmTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
DenseMapTest.cpp [unittests] ADT: silence -Wself-assign diagnostics 2018-04-07 10:37:18 +00:00
DenseSetTest.cpp Fix typos of occurred and occurrence 2018-01-24 10:33:39 +00:00
DepthFirstIteratorTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
EquivalenceClassesTest.cpp [NFC] Add missing unit tests for EquivalenceClasses 2017-11-27 11:20:58 +00:00
FoldingSet.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
FunctionRefTest.cpp [ADT] Add a default constructor and a bool conversion to function_ref. 2017-07-09 06:12:56 +00:00
HashingTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
IListBaseTest.cpp
IListIteratorTest.cpp
IListNodeBaseTest.cpp
IListNodeTest.cpp
IListSentinelTest.cpp
IListTest.cpp
ImmutableMapTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
ImmutableSetTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
IntEqClassesTest.cpp
IntervalMapTest.cpp
IntrusiveRefCntPtrTest.cpp
IteratorTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
MakeUniqueTest.cpp
MappedIteratorTest.cpp [ADT] Rewrite mapped_iterator in terms of iterator_adaptor_base. 2017-11-10 17:41:28 +00:00
MapVectorTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
OptionalTest.cpp [ADT] Make moving Optional not reset the Optional it moves from. 2018-01-25 17:24:22 +00:00
PackedVectorTest.cpp
PointerEmbeddedIntTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
PointerIntPairTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
PointerSumTypeTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
PointerUnionTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
PostOrderIteratorTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
PriorityWorklistTest.cpp
RangeAdapterTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
SCCIteratorTest.cpp Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC. 2017-06-15 21:00:40 +00:00
ScopeExitTest.cpp Give scope_exit helper correct move semantics 2018-01-25 16:55:48 +00:00
SequenceTest.cpp
SetVectorTest.cpp
SimpleIListTest.cpp
SmallPtrSetTest.cpp [unittests] ADT: silence -Wself-assign diagnostics 2018-04-07 10:37:18 +00:00
SmallStringTest.cpp
SmallVectorTest.cpp [ADT] Don't use __used__ attribute on struct members in unit test 2017-06-12 14:19:25 +00:00
SparseBitVectorTest.cpp [unittests] ADT: silence -Wself-assign diagnostics 2018-04-07 10:37:18 +00:00
SparseMultiSetTest.cpp
SparseSetTest.cpp
StatisticTest.cpp Fix unused function warning in StatisticTest.cpp 2018-03-08 15:52:45 +00:00
STLExtrasTest.cpp [unittests] Change std::sort to llvm::sort in response to r327219 2018-04-07 01:29:45 +00:00
StringExtrasTest.cpp [Support] Add unit test for printLowerCase 2017-11-28 16:11:56 +00:00
StringMapTest.cpp [unittests] Change std::sort to llvm::sort in response to r327219 2018-04-07 01:29:45 +00:00
StringRefTest.cpp Fix incorrect usage of std::is_assignable. 2018-02-02 22:29:54 +00:00
StringSwitchTest.cpp [ADT] Simplify and optimize StringSwitch 2018-02-26 18:41:26 +00:00
TestGraph.h
TinyPtrVectorTest.cpp Ensure moved-from container is cleared on move 2017-12-11 19:22:59 +00:00
TripleTest.cpp [AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU 2018-03-23 18:45:18 +00:00
TwineTest.cpp Revert "[ADT] Make Twine's copy constructor private." 2017-10-11 23:54:34 +00:00
VariadicFunctionTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00