Mercurial > hg > CbC > CbC_gcc
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr86269.C Thu Feb 13 11:34:05 2020 +0900 @@ -0,0 +1,19 @@ +// { 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); +}