public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65634] New: [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement
@ 2015-03-31  5:32 tom at honermann dot net
  2015-04-03 13:44 ` [Bug c++/65634] " andrew.n.sutton at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tom at honermann dot net @ 2015-03-31  5:32 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/65634] [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement
  2015-03-31  5:32 [Bug c++/65634] New: [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement tom at honermann dot net
@ 2015-04-03 13:44 ` andrew.n.sutton at gmail dot com
  2015-04-03 13:46 ` andrew.n.sutton at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: andrew.n.sutton at gmail dot com @ 2015-04-03 13:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65634

--- Comment #1 from Andrew Sutton <andrew.n.sutton at gmail dot com> ---
Created attachment 35222
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35222&action=edit
Proposed solution


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/65634] [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement
  2015-03-31  5:32 [Bug c++/65634] New: [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement tom at honermann dot net
  2015-04-03 13:44 ` [Bug c++/65634] " andrew.n.sutton at gmail dot com
@ 2015-04-03 13:46 ` andrew.n.sutton at gmail dot com
  2015-04-07 18:28 ` tom at honermann dot net
  2015-07-09 22:13 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: andrew.n.sutton at gmail dot com @ 2015-04-03 13:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65634

--- Comment #2 from Andrew Sutton <andrew.n.sutton at gmail dot com> ---
Confirmed and fixed 221854, but I'd like a maintainer to look at the attached
patch. 

The bug was caused by asking for TYPE_NOTHROW_P on the function return type
instead of the function type. Strangely, this is only affecting this one test
case and none of the other noexcept tests.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/65634] [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement
  2015-03-31  5:32 [Bug c++/65634] New: [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement tom at honermann dot net
  2015-04-03 13:44 ` [Bug c++/65634] " andrew.n.sutton at gmail dot com
  2015-04-03 13:46 ` andrew.n.sutton at gmail dot com
@ 2015-04-07 18:28 ` tom at honermann dot net
  2015-07-09 22:13 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: tom at honermann dot net @ 2015-04-07 18:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65634

--- Comment #3 from Tom Honermann <tom at honermann dot net> ---
Confirmed fixed with r221861.  I'll leave the bug open though since comment 2
is requesting additional followup.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/65634] [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement
  2015-03-31  5:32 [Bug c++/65634] New: [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement tom at honermann dot net
                   ` (2 preceding siblings ...)
  2015-04-07 18:28 ` tom at honermann dot net
@ 2015-07-09 22:13 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-09 22:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65634

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Andrew and I discussed the patch separately.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-09 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31  5:32 [Bug c++/65634] New: [c++-concepts] ICE in check_noexcept_r() for a noexcept constraint on a static member function call requirement tom at honermann dot net
2015-04-03 13:44 ` [Bug c++/65634] " andrew.n.sutton at gmail dot com
2015-04-03 13:46 ` andrew.n.sutton at gmail dot com
2015-04-07 18:28 ` tom at honermann dot net
2015-07-09 22:13 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).