]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/20_util/result_of/sfinae_friendly_2.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / result_of / sfinae_friendly_2.cc
index 57dcc5f66d13984d16b6563df042576ca22b23cb..85acacca3f5d6503fb26d3670ead76f14e20e314 100644 (file)
@@ -1,7 +1,6 @@
-// { dg-options "-std=gnu++11" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
 
-// Copyright (C) 2012 Free Software Foundation, Inc.
+// Copyright (C) 2012-2024 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #include <type_traits>
 #include <string>
 
-struct eat { template<class T> eat(T const &) {} };
+struct eat { template<typename T> eat(T const &) {} };
 struct not_incrementable {};
 
 struct inc {
- template<class T>
+ template<typename T>
  auto operator()(T t) const -> decltype(t++)
  { return t++; }
 };
 
-template<class A>
+template<typename A>
 typename std::result_of<inc(A)>::type // sfinae here
 try_inc(A a) {
   return inc()(a);
@@ -43,10 +42,10 @@ try_inc(eat) {
   return not_incrementable();
 }
 
-template<class>
+template<typename>
 struct never { static const bool value = false; };
 
-template<class T>
+template<typename T>
 struct Fail
 {
   static_assert(never<T>::value, "duh");
@@ -55,16 +54,16 @@ struct Fail
 
 struct Fun
 {
-  template<class T>
+  template<typename T>
   typename Fail<T>::type operator()(T)
   { return 0; }
 };
 
-template<class T>
+template<typename T>
 typename std::result_of<Fun(T)>::type foo(T)
 { return 0; }
 
-template<class>
+template<typename>
 int foo(...)
 { return 0; }