From 9efb55ac054852c4ea4f082504363c2a66f41dfe Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 17 Oct 2017 19:36:49 +0000 Subject: 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 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/concepts/pr71368.C | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/g++.dg/concepts/pr71368.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f344a46..3da50bf 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 0000000..f0e0a95 --- /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 ); +} -- cgit v1.1