From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4692 invoked by alias); 16 Feb 2014 16:54:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4649 invoked by uid 48); 16 Feb 2014 16:54:52 -0000 From: "reichelt at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg01589.txt.bz2 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 struct A { template struct B; template struct B {}; }; ========================================== 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 struct B {}; ^ 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?