From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2189 invoked by alias); 15 Feb 2014 22:58:01 -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 1774 invoked by uid 48); 15 Feb 2014 22:57:58 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60219] New: [4.8/4.9 Regression] [c++11] ICE invalid use of variadic template Date: Sat, 15 Feb 2014 22:58: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: diagnostic, ice-on-invalid-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 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/msg01429.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60219 Bug ID: 60219 Summary: [4.8/4.9 Regression] [c++11] ICE invalid use of variadic template Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: diagnostic, ice-on-invalid-code 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 since GCC 4.8.0: ============================================= template void foo(); void bar() { foo<0>; } ============================================= bug.cc: In function 'void bar()': bug.cc:5:9: internal compiler error: tree check: accessed elt 3 of tree_vec with 2 elts in coerce_template_parms, at cp/pt.c:6857 foo<0>; ^ 0xdca805 tree_vec_elt_check_failed(int, int, char const*, int, char const*) ../../gcc/gcc/tree.c:9377 0x61aa12 tree_vec_elt_check ../../gcc/gcc/tree.h:2899 0x61aa12 coerce_template_parms ../../gcc/gcc/cp/pt.c:6857 0x633577 resolve_nondeduced_context(tree_node*) ../../gcc/gcc/cp/pt.c:16561 0x6f9907 convert_to_void(tree_node*, impl_conv_void, int) ../../gcc/gcc/cp/cvt.c:1244 0x726d8a finish_expr_stmt(tree_node*) ../../gcc/gcc/cp/semantics.c:684 0x6ae3e8 cp_parser_statement ../../gcc/gcc/cp/parser.c:9473 0x6af1b9 cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:9745 0x6af326 cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:9699 0x6c34fb cp_parser_function_body ../../gcc/gcc/cp/parser.c:18641 0x6c34fb cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:18677 0x6c7842 cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:22792 0x6c86e1 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/gcc/cp/parser.c:22704 0x6c86e1 cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16585 0x6c9979 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11205 0x6acc63 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11086 0x6d3f12 cp_parser_declaration ../../gcc/gcc/cp/parser.c:10983 0x6d2c08 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10869 0x6d44aa cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4014 0x6d44aa c_parse_file() ../../gcc/gcc/cp/parser.c:31536 Please submit a full bug report, [etc.] If I actually try to call foo<0>, I get a broken diagnostic ending in a colon: ============================================== template void foo(); void bar() { foo<0>(); } ============================================== bug.cc: In function 'void bar()': bug.cc:5:10: error: no matching function for call to 'foo()' foo<0>(); ^ bug.cc:5:10: note: candidate is: bug.cc:1:33: note: template > void foo() template void foo(); ^ bug.cc:1:33: note: template argument deduction/substitution failed: Why?