diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2017-10-17 19:36:49 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2017-10-17 19:36:49 +0000 |
commit | 9efb55ac054852c4ea4f082504363c2a66f41dfe (patch) | |
tree | 1f6d418e4f4ce3be0e3d3a39f47169db49a53988 | |
parent | 8240d00373f62c8c36fc4be2c91178d8c3431f38 (diff) | |
download | gcc-9efb55ac054852c4ea4f082504363c2a66f41dfe.zip gcc-9efb55ac054852c4ea4f082504363c2a66f41dfe.tar.gz gcc-9efb55ac054852c4ea4f082504363c2a66f41dfe.tar.bz2 |
re PR c++/71368 ([concepts] ICE on constrained compound requirement)
2017-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71368
* g++.dg/concepts/pr71368.C: New.
From-SVN: r253826
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/concepts/pr71368.C | 25 |
2 files changed, 30 insertions, 0 deletions
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 <paolo.carlini@oracle.com> + + PR c++/71368 + * g++.dg/concepts/pr71368.C: New. + 2017-10-17 Nathan Sidwell <nathan@acm.org> 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<typename X> concept bool CompoundReq = requires { + // fine with concrete type in trailing type, i.e. inner& instead of X& + { X::inner_member() } -> X&; +}; + +template<typename X> 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<inner> ); + static_assert( CompoundReq<decltype( outer::outer_member() )> ); + + // ICE + static_assert( Concept<outer> ); +} |