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++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter
Date: Sun, 16 Feb 2014 16:54:00 -0000	[thread overview]
Message-ID: <bug-60222-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 60222
           Summary: [4.8/4.9 Regression] ICE with reference as template
                    parameter
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: jason at gcc dot gnu.org

The following valid code snippet triggers an ICE on the 4.8 branch and trunk:

==========================================
template<int&> struct A
{
  template<typename> struct B;

  template<typename T> struct B<T*> {};
};
==========================================

bug.cc:5:35: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have template_decl in lookup_template_class_1,
at cp/pt.c:7674
   template<typename T> struct B<T*> {};
                                   ^
0xdbfcc4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9192
0x5bc4b9 tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
        ../../gcc/gcc/tree.h:2749
0x6251fc lookup_template_class_1
        ../../gcc/gcc/cp/pt.c:7674
0x6251fc lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../../gcc/gcc/cp/pt.c:7725
0x72dcb2 finish_template_type(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/semantics.c:2953
0x6c2068 cp_parser_template_id
        ../../gcc/gcc/cp/parser.c:13440
0x6c2388 cp_parser_class_name
        ../../gcc/gcc/cp/parser.c:19074
0x6b3bb9 cp_parser_qualifying_entity
        ../../gcc/gcc/cp/parser.c:5524
0x6b3bb9 cp_parser_nested_name_specifier_opt
        ../../gcc/gcc/cp/parser.c:5249
0x6aa243 cp_parser_class_head
        ../../gcc/gcc/cp/parser.c:19529
0x6aa243 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19155
0x6aa243 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19437
0x6aa243 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14302
0x6c2ba0 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6c8883 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:23039
0x6c8d64 cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:22915
0x6a5f36 cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:20049
0x6a9724 cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:19976
0x6a9724 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19210
0x6a9724 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19437
Please submit a full bug report, [etc.]

The example compiles fine with GCC 4.8.0 - 4.8.2.

The regression might be fallout from the fix for PR58606.
Jason, would you mind having a look?


             reply	other threads:[~2014-02-16 16:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-16 16:54 reichelt at gcc dot gnu.org [this message]
2014-02-16 16:55 ` [Bug c++/60222] " reichelt at gcc dot gnu.org
2014-02-17 10:00 ` jakub at gcc dot gnu.org
2014-02-21  4:56 ` [Bug c++/60222] [4.9 " jason at gcc dot gnu.org
2014-02-21 14:01 ` jason at gcc dot gnu.org
2014-02-21 14:30 ` jakub 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-60222-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).