view gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// { dg-do compile { target c++2a } }
// { dg-additional-options "-fconcepts-ts" }
#include <type_traits>

template<typename t2, typename t = std::remove_reference_t<t2>>
concept bool IntegralOrIntegralRef = std::is_integral_v<t>;

template<IntegralOrIntegralRef t>
auto foo(t && v)
{
  return v;
}

int main()
{
  int i = 7;
  foo(8);
  return foo(i);
}