Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <deque>

// class deque

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <deque>

#include "test_macros.h"

int main ()
{
std::deque<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
28 changes: 28 additions & 0 deletions libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <forward_list>

// class forward_list

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <forward_list>

#include "test_macros.h"

int main ()
{
std::forward_list<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <list>

// class list

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <list>

#include "test_macros.h"

int main ()
{
std::list<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
28 changes: 28 additions & 0 deletions libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <vector>

// class vector

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <vector>

#include "test_macros.h"

int main ()
{
std::vector<bool> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <vector>

// class vector

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <vector>

#include "test_macros.h"

int main ()
{
std::vector<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
28 changes: 28 additions & 0 deletions libcxx/test/std/containers/unord/unord.map/empty.fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <unordered_map>

// class unordered_map

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <unordered_map>

#include "test_macros.h"

int main ()
{
std::unordered_map<int, int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
28 changes: 28 additions & 0 deletions libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <unordered_map>

// class unordered_multimap

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <unordered_map>

#include "test_macros.h"

int main ()
{
std::unordered_multimap<int, int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
28 changes: 28 additions & 0 deletions libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <unordered_set>

// class unordered_multiset

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <unordered_set>

#include "test_macros.h"

int main ()
{
std::unordered_multiset<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
28 changes: 28 additions & 0 deletions libcxx/test/std/containers/unord/unord.set/empty.fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <unordered_set>

// class unordered_set

// bool empty() const noexcept;

// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8

#include <unordered_set>

#include "test_macros.h"

int main ()
{
std::unordered_set<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}