Fix libstdc++ tests for -Wvolatile warnings in C++2a mode
authorJonathan Wakely <jwakely@redhat.com>
Wed, 11 Sep 2019 11:38:15 +0000 (12:38 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 11 Sep 2019 11:38:15 +0000 (12:38 +0100)
* 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.

From-SVN: r275643

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/result_of/sfinae_friendly_1.cc
libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc

index b12ebe56913de8af109638ad2e64f06d7c0714fb..9472efb1bfde91ba4d404cd3934f4ee3613d72d3 100644 (file)
@@ -1,3 +1,10 @@
+2019-09-11  Jonathan Wakely  <jwakely@redhat.com>
+
+       * 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.
+
 2019-09-10  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/std/type_traits (__do_common_type_impl): Implement
index ed3e011f937ccc195fe26ca0a987b920210f6b3c..86aa52029cce9af32e99c903af616cc8a6614cc4 100644 (file)
@@ -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!");
index 02cf8bf8c6dc39e6015fd9befeb6fe3b7f87945e..dea0665b1e3125f0e3a39fb1f1c8e36a2397680a 100644 (file)
@@ -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>