* [PATCH] Fix libstdc++ tests for -Wvolatile warnings in C++2a mode
@ 2019-09-11 11:38 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2019-09-11 11:38 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
* testsuite/20_util/result_of/sfinae_friendly_1.cc: Add -Wno-volatile
for C++2a and up. Define HAS_52748_FIXED and fix incorrect tests.
* testsuite/tr1/3_function_objects/result_of.cc: Add -Wno-volatile
for C++2a and up.
Tested x86_64-linux, committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2808 bytes --]
commit 25f120f074c602424f5a05bd629deabccd77f75e
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed Sep 11 11:38:15 2019 +0000
Fix libstdc++ tests for -Wvolatile warnings in C++2a mode
* testsuite/20_util/result_of/sfinae_friendly_1.cc: Add -Wno-volatile
for C++2a and up. Define HAS_52748_FIXED and fix incorrect tests.
* testsuite/tr1/3_function_objects/result_of.cc: Add -Wno-volatile
for C++2a and up.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@275643 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/libstdc++-v3/testsuite/20_util/result_of/sfinae_friendly_1.cc b/libstdc++-v3/testsuite/20_util/result_of/sfinae_friendly_1.cc
index ed3e011f937..86aa52029cc 100644
--- a/libstdc++-v3/testsuite/20_util/result_of/sfinae_friendly_1.cc
+++ b/libstdc++-v3/testsuite/20_util/result_of/sfinae_friendly_1.cc
@@ -1,4 +1,5 @@
// { dg-do compile { target c++11 } }
+// { dg-additional-options "-Wno-volatile" { target c++2a } }
// Copyright (C) 2012-2019 Free Software Foundation, Inc.
//
@@ -21,9 +22,9 @@
#include <cstddef>
#include <type_traits>
-// TODO: Uncomment the following define once gcc has fixed bug 52748
+// Uncomment the following define once gcc has fixed bug 52748
// (incomplete types in function call expressions):
-//#define HAS_52748_FIXED
+#define HAS_52748_FIXED
// Helper types:
struct has_type_impl
@@ -627,9 +628,9 @@ static_assert(is_type<std::result_of
static_assert(is_type<std::result_of
<variable_functor<Ukn>&(int, int, int)>, Ukn>(), "Error!");
-static_assert(is_type<std::result_of<PMSIncomplete(int)>, Ukn>(), "Error!");
-static_assert(is_type<std::result_of<PMSIncomplete&(int)>, Ukn>(), "Error!");
-static_assert(is_type<std::result_of<PMSIncomplete&&(int)>, Ukn>(), "Error!");
+static_assert(is_type<std::result_of<PMSIncomplete(S*, int)>, Ukn>(), "Error!");
+static_assert(is_type<std::result_of<PMSIncomplete&(const S&, int)>, Ukn>(), "Error!");
+static_assert(is_type<std::result_of<PMSIncomplete&&(S&&, int)>, Ukn>(), "Error!");
static_assert(is_type<std::result_of<FuncIncomplete(int)>, Ukn>(), "Error!");
static_assert(is_type<std::result_of<FuncIncomplete&(int)>, Ukn>(), "Error!");
diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc
index 02cf8bf8c6d..dea0665b1e3 100644
--- a/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc
+++ b/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc
@@ -17,6 +17,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+// { dg-additional-options "-Wno-volatile" { target c++2a } }
+
// 3.4 function return types
#include <tr1/functional>
#include <tr1/type_traits>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-11 11:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 11:38 [PATCH] Fix libstdc++ tests for -Wvolatile warnings in C++2a mode Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).