]> granicus.if.org Git - llvm/commitdiff
[ADT] Don't use __used__ attribute on struct members in unit test
authorFrancis Ricci <francisjricci@gmail.com>
Mon, 12 Jun 2017 14:19:25 +0000 (14:19 +0000)
committerFrancis Ricci <francisjricci@gmail.com>
Mon, 12 Jun 2017 14:19:25 +0000 (14:19 +0000)
On some compilers, __used__ can only be applied to variables
or functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305188 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ADT/SmallVectorTest.cpp

index bf81e6a1c8b10ea5a359155a50b27669ba9aa642..9c501bbdf1a3ccc3d43217cbacb21915e654a278 100644 (file)
@@ -440,19 +440,19 @@ TYPED_TEST(SmallVectorTest, AppendNonIterTest) {
   this->assertValuesInOrder(this->theVector, 3u, 1, 7, 7);
 }
 
+struct output_iterator {
+  typedef std::output_iterator_tag iterator_category;
+  typedef int value_type;
+  typedef int difference_type;
+  typedef value_type *pointer;
+  typedef value_type &reference;
+  operator int() { return 2; }
+  operator Constructable() { return 7; }
+};
+
 TYPED_TEST(SmallVectorTest, AppendRepeatedNonForwardIterator) {
   SCOPED_TRACE("AppendRepeatedTest");
 
-  struct output_iterator {
-    typedef LLVM_ATTRIBUTE_USED std::output_iterator_tag iterator_category;
-    typedef LLVM_ATTRIBUTE_USED int value_type;
-    typedef LLVM_ATTRIBUTE_USED int difference_type;
-    typedef LLVM_ATTRIBUTE_USED value_type *pointer;
-    typedef LLVM_ATTRIBUTE_USED value_type &reference;
-    operator int() { return 2; }
-    operator Constructable() { return 7; }
-  };
-
   this->theVector.push_back(Constructable(1));
   this->theVector.append(output_iterator(), output_iterator());
   this->assertValuesInOrder(this->theVector, 3u, 1, 7, 7);