public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59111] New: [4.9 Regression] [c++11] ICE on invalid usage of auto in return type
Date: Wed, 13 Nov 2013 14:12:00 -0000	[thread overview]
Message-ID: <bug-59111-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59111

            Bug ID: 59111
           Summary: [4.9 Regression] [c++11] ICE on invalid usage of auto
                    in return type
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid code snippet (compiled with "-std=c++11") triggers an ICE
on trunk:

=====================
auto& foo();

int i = foo();
=====================

bug.cc:1:11: warning: 'foo' function uses 'auto' type specifier without
trailing return type [enabled by default]
 auto& foo();
           ^
bug.cc:3:13: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have template_type_parm in lookup_conversions,
at cp/search.c:2509
 int i = foo();
             ^
0xd3a614 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9166
0x6bd9f7 tree_check3
        ../../gcc/gcc/tree.h:2746
0x6bd9f7 lookup_conversions(tree_node*)
        ../../gcc/gcc/cp/search.c:2509
0x5493a6 build_user_type_conversion_1
        ../../gcc/gcc/cp/call.c:3447
0x54a3c1 implicit_conversion
        ../../gcc/gcc/cp/call.c:1756
0x54ff6c can_convert_arg_bad(tree_node*, tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/call.c:8960
0x677940 convert_for_assignment
        ../../gcc/gcc/cp/typeck.c:7992
0x5eff71 digest_init_r
        ../../gcc/gcc/cp/typeck2.c:1009
0x5f1dc2 digest_init_flags
        ../../gcc/gcc/cp/typeck2.c:1078
0x5f1dc2 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/gcc/cp/typeck2.c:766
0x566066 check_initializer
        ../../gcc/gcc/cp/decl.c:5739
0x57909d cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6358
0x666c11 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16727
0x66837f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11118
0x64c7b0 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10999
0x670477 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10896
0x66f198 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10782
0x670a3a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4010
0x670a3a c_parse_file()
        ../../gcc/gcc/cp/parser.c:31187
0x791cd3 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1055
Please submit a full bug report, [etc.]


             reply	other threads:[~2013-11-13 14:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 14:12 reichelt at gcc dot gnu.org [this message]
2013-11-13 15:37 ` [Bug c++/59111] " rguenth at gcc dot gnu.org
2013-11-21 14:37 ` rguenth at gcc dot gnu.org
2013-12-18 14:49 ` mpolacek at gcc dot gnu.org
2013-12-18 14:50 ` mpolacek at gcc dot gnu.org
2013-12-23 12:15 ` mpolacek at gcc dot gnu.org
2013-12-23 12:35 ` mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-59111-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).