https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65634
Bug ID: 65634 Summary: [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tom at honermann dot net Encountered with the latest revision of the gcc c++-concepts branch (r221742). An internal compiler error occurs when a compound-requirement expression specifies a noexcept static member function call requirement. The ICE only seems to occur when performing a constraint check on a member type on behalf of another concept. Changing the return type of M1::smf() below does not affect whether an ICE occurs, but does affect the error message that is generated (instead of void_type, one might see integer_type, reference_type, etc...). $ svn info # From my local svn gcc repo. Path: . URL: svn://gcc.gnu.org/svn/gcc/branches/c++-concepts Repository Root: svn://gcc.gnu.org/svn/gcc Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4 Revision: 221742 Node Kind: directory Schedule: normal Last Changed Author: asutton Last Changed Rev: 221733 Last Changed Date: 2015-03-27 10:44:22 -0400 (Fri, 27 Mar 2015) $ cat t.cpp template<typename T> concept bool C1() { return requires () { { T::smf() } noexcept; }; } struct M1 { static void smf() noexcept; }; template<typename T> concept bool C2() { return C1<typename T::type>(); } struct M2 { using type = M1; }; static_assert(C2<M2>(), ""); $ g++ -c -std=c++1z t.cpp t.cpp:12:32: internal compiler error: tree check: expected function_type or method_type, have void_type in check_noexcept_r, at cp/except.c:1181 return C1<typename T::type>(); ^ 0xf1faec tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc-c++-concepts2/c++-concepts/gcc/tree.c:9296 0x7758c0 tree_check2(tree_node*, char const*, int, char const*, tree_code, tree_code) ../../gcc-c++-concepts2/c++-concepts/gcc/tree.h:2865 0x7758c0 check_noexcept_r ../../gcc-c++-concepts2/c++-concepts/gcc/cp/except.c:1181 0xf40582 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*)) ../../gcc-c++-concepts2/c++-concepts/gcc/tree.c:11092 0xf431c8 walk_tree_without_duplicates_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*)) ../../gcc-c++-concepts2/c++-concepts/gcc/tree.c:11422 0x77552f expr_noexcept_p(tree_node*, int) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/except.c:1255 0x829c7a check_exception_constraint ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1713 0x829c7a check_constraint ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1798 0x82a0b3 check_conjunction ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1747 0x82a0b3 check_constraint ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1804 0x829ecd check_parameterized_constraint ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1730 0x829ecd check_constraint ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1801 0x620cc3 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, int) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/call.c:4161 0x79f4da finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/semantics.c:2407 0x67e887 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/pt.c:15789 0x682b56 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/pt.c:14970 0x82da7f lift_function_definition ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:340 0x82db43 evaluate_function_concept(tree_node*, tree_node*) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/constraint.cc:1885 0x620cc3 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, int) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/call.c:4161 0x79f4da finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../gcc-c++-concepts2/c++-concepts/gcc/cp/semantics.c:2407