From: Paolo Carlini Date: Tue, 17 Oct 2017 19:36:49 +0000 (+0000) Subject: re PR c++/71368 ([concepts] ICE on constrained compound requirement) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9efb55ac054852c4ea4f082504363c2a66f41dfe;p=gcc.git re PR c++/71368 ([concepts] ICE on constrained compound requirement) 2017-10-17 Paolo Carlini PR c++/71368 * g++.dg/concepts/pr71368.C: New. From-SVN: r253826 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f344a46479c..3da50bfe4f1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-17 Paolo Carlini + + PR c++/71368 + * g++.dg/concepts/pr71368.C: New. + 2017-10-17 Nathan Sidwell PR c++/82560 diff --git a/gcc/testsuite/g++.dg/concepts/pr71368.C b/gcc/testsuite/g++.dg/concepts/pr71368.C new file mode 100644 index 00000000000..f0e0a956366 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pr71368.C @@ -0,0 +1,25 @@ +// { dg-options "-std=c++17 -fconcepts" } + +struct inner; + +template concept bool CompoundReq = requires { + // fine with concrete type in trailing type, i.e. inner& instead of X& + { X::inner_member() } -> X&; +}; + +template concept bool Concept = requires { + { X::outer_member() } -> CompoundReq; +}; + +struct inner { static inner& inner_member(); }; +struct outer { static inner outer_member(); }; + +int main() +{ + // fine + static_assert( CompoundReq ); + static_assert( CompoundReq ); + + // ICE + static_assert( Concept ); +}