Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-2.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line source
// PR c++/67225 // { dg-do compile { target c++2a } } // { dg-additional-options "-fconcepts-ts" } template<typename Target> // template<typename Target, typename... Ts> concept bool has_resize () { return requires (Target tgt) { { tgt.resize () }; }; } template<typename Target> void resize (Target tgt) { if constexpr (has_resize<Target> ()) { tgt.resize (); } } class MyClass { private: int foo (int i) { return i * 2; } }; int main () { return MyClass {}.foo (7); // { dg-error "private within this context" } }