view gcc/testsuite/g++.dg/concepts/pr65854.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do compile { target c++17 } }
// { dg-options "-fconcepts" }

// Handle alias templates in type requirements.

template<typename T1, typename T2>
struct BTT { };

template<typename T>
struct BTT<T,T> { using type = int; };

template<typename T1, typename T2>
using Alias1 = typename BTT<T1, T2>::type;

template<typename T1, typename T2>
concept bool C()
{
  return requires() { typename Alias1<T1, T2>; };
}

template<typename T1, typename T2>
  requires C<T1, T2>()
int f();

auto i = f<char, int>(); // { dg-error "cannot call function" }