public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58567] New: [4.8/4.9 Regression] ICE with invalid loop variable in template using openmp
@ 2013-09-28 19:49 reichelt at gcc dot gnu.org
  2013-09-30  7:12 ` [Bug c++/58567] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-09-28 19:49 UTC (permalink / raw)
  To: gcc-bugs

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<typename T> void foo()
{
  #pragma omp parallel for
  for (typename T::X i = 0; i < 100; ++i)
    ;
}

void bar()
{
  foo<int>();
}
================================================

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.]


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-01 21:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-28 19:49 [Bug c++/58567] New: [4.8/4.9 Regression] ICE with invalid loop variable in template using openmp reichelt at gcc dot gnu.org
2013-09-30  7:12 ` [Bug c++/58567] " mpolacek at gcc dot gnu.org
2013-09-30 10:15 ` rguenth at gcc dot gnu.org
2013-10-16  9:51 ` jakub at gcc dot gnu.org
2013-11-05 14:43 ` rguenth at gcc dot gnu.org
2013-12-04 23:56 ` burnus at gcc dot gnu.org
2014-01-03 20:25 ` burnus at gcc dot gnu.org
2014-01-29 18:23 ` [Bug c++/58567] [4.8 " paolo.carlini at oracle dot com
2014-03-01 21:43 ` reichelt at gcc dot gnu.org

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).