From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21939 invoked by alias); 28 Sep 2013 19:49:57 -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 21908 invoked by uid 48); 28 Sep 2013 19:49:54 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58567] New: [4.8/4.9 Regression] ICE with invalid loop variable in template using openmp Date: Sat, 28 Sep 2013 19:49: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: 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 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: 2013-09/txt/msg01971.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58567 Bug ID: 58567 Summary: [4.8/4.9 Regression] ICE with invalid loop variable in template using openmp 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 "-fopenmp") triggers an ICE since GCC 4.8.0: ================================================ template void foo() { #pragma omp parallel for for (typename T::X i = 0; i < 100; ++i) ; } void bar() { foo(); } ================================================ bug.cc: In instantiation of 'void foo() [with T = int]': bug.cc:10:12: required from here bug.cc:4:22: error: 'int' is not a class, struct, or union type for (typename T::X i = 0; i < 100; ++i) ^ bug.cc:4:3: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in tsubst_omp_for_iterator, at cp/pt.c:12938 for (typename T::X i = 0; i < 100; ++i) ^ 0xcdaef7 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.c:9348 0x5aa6b1 contains_struct_check ../../gcc/gcc/tree.h:2723 0x5aa6b1 tsubst_omp_for_iterator ../../gcc/gcc/cp/pt.c:12938 0x5a55ee tsubst_expr ../../gcc/gcc/cp/pt.c:13481 0x5a43d8 tsubst_expr ../../gcc/gcc/cp/pt.c:13446 0x5a4451 tsubst_expr ../../gcc/gcc/cp/pt.c:13284 0x5a1dcf instantiate_decl(tree_node*, int, bool) ../../gcc/gcc/cp/pt.c:19391 0x5de71f instantiate_pending_templates(int) ../../gcc/gcc/cp/pt.c:19492 0x6198c7 cp_write_global_declarations() ../../gcc/gcc/cp/decl2.c:4060 Please submit a full bug report, [etc.]