Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/concepts/req11.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" } // Check that we can evaluate constant requires-expressions // as constant expressions, for the curious case when they // appear within predicate constraints. template<typename... Ts> struct variant { }; template<typename T> concept bool Streamable() { return requires (T t) { t; }; } template<typename T> concept bool Range() { return requires (T t) { t; }; } template<class T> requires Streamable<T>() and not Range<T>() void print(const T& x) { } int main() { print("hello"); // { dg-error "cannot call" } }