]> gcc.gnu.org Git - gcc.git/commitdiff
libstdc++: Fix test that uses C++17 variable template in C++14
authorJonathan Wakely <jwakely@redhat.com>
Thu, 10 Nov 2022 14:04:07 +0000 (14:04 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 11 Nov 2022 04:00:58 +0000 (04:00 +0000)
This test fails if run with -std=gnu++14 because it should be using
is_convertible instead of is_convertible_v.

libstdc++-v3/ChangeLog:

* testsuite/experimental/propagate_const/observers/107525.cc:
Use type trait instead of C++17 variable template.

libstdc++-v3/testsuite/experimental/propagate_const/observers/107525.cc

index e7ecff73c1ae7fea8c6044ce3bc2ce7909e0026f..37e970c3af45e6e36abeba793328fc4d3ce7233f 100644 (file)
@@ -32,10 +32,10 @@ test_const_conversion()
     operator const int*() const = delete;
   };
 
-  static_assert(!std::is_convertible_v<const X, const int*>,
+  static_assert(!std::is_convertible<const X, const int*>::value,
                "Cannot convert const X to const int*");
   // So should not be able to convert const propagate_const<X> to const int*.
-  static_assert(!std::is_convertible_v<const propagate_const<X>, const int*>,
+  static_assert(!std::is_convertible<const propagate_const<X>, const int*>::value,
                "So should not be able to convert const propagate_const<X> to "
                "const int* (although this is not what LFTSv3 says)");
 }
This page took 0.061024 seconds and 5 git commands to generate.