summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/function.objects
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/utilities/function.objects')
-rw-r--r--libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp2
-rw-r--r--libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp24
-rw-r--r--libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp9
3 files changed, 29 insertions, 6 deletions
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp
index a0c686de77b..180433109f2 100644
--- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_function_object.pass.cpp
@@ -29,7 +29,7 @@ struct DummyUnaryFunction
struct BadUnaryFunction
{
template <typename S>
- constexpr int operator()(S const & s) const
+ constexpr int operator()(S const &) const
{
// Trigger a compile error if this function is instantiated.
// The constexpr is needed so that it is instantiated while checking
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
index 68986ac1aeb..c1f2899f153 100644
--- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
@@ -56,8 +56,32 @@ constexpr decltype(std::placeholders::_9) cp9 = std::placeholders::_9;
constexpr decltype(std::placeholders::_10) cp10 = std::placeholders::_10;
#endif // TEST_STD_VER >= 11
+void use_placeholders_to_prevent_unused_warning() {
+ ((void)cp1);
+ ((void)cp2);
+ ((void)cp3);
+ ((void)cp4);
+ ((void)cp5);
+ ((void)cp6);
+ ((void)cp7);
+ ((void)cp8);
+ ((void)cp9);
+ ((void)cp10);
+ ((void)default1);
+ ((void)default2);
+ ((void)default3);
+ ((void)default4);
+ ((void)default5);
+ ((void)default6);
+ ((void)default7);
+ ((void)default8);
+ ((void)default9);
+ ((void)default10);
+}
+
int main()
{
+ use_placeholders_to_prevent_unused_warning();
test(std::placeholders::_1);
test(std::placeholders::_2);
test(std::placeholders::_3);
diff --git a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
index f104385f08b..47a3e1cc596 100644
--- a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
@@ -138,26 +138,26 @@ inline constexpr CallType operator|(CallType LHS, CallType RHS) {
struct ForwardingCallObject {
template <class ...Args>
- bool operator()(Args&&... args) & {
+ bool operator()(Args&&...) & {
set_call<Args&&...>(CT_NonConst | CT_LValue);
return true;
}
template <class ...Args>
- bool operator()(Args&&... args) const & {
+ bool operator()(Args&&...) const & {
set_call<Args&&...>(CT_Const | CT_LValue);
return true;
}
// Don't allow the call operator to be invoked as an rvalue.
template <class ...Args>
- bool operator()(Args&&... args) && {
+ bool operator()(Args&&...) && {
set_call<Args&&...>(CT_NonConst | CT_RValue);
return true;
}
template <class ...Args>
- bool operator()(Args&&... args) const && {
+ bool operator()(Args&&...) const && {
set_call<Args&&...>(CT_Const | CT_RValue);
return true;
}
@@ -526,7 +526,6 @@ void call_operator_forwarding_test()
assert(Fn::check_call<int&&>(CT_Const | CT_RValue));
}
{ // test multi arg
- int x = 42;
const double y = 3.14;
std::string s = "abc";
obj(42, std::move(y), s, std::string{"foo"});
OpenPOWER on IntegriCloud