1// PR c++/31598 2// { dg-do compile } 3// 4// Copyright (C) 2007 Free Software Foundation, Inc. 5// Contributed by Theodore.Papadopoulo 6// 16 Apr 2007 <Theodore.Papadopoulo@sophia.inria.fr> 7 8int i; 9template <typename> struct A { A() {} }; 10template <typename> struct C { C() { i++; } C(const C &) { i += 2; } }; 11struct D { D() {} }; 12 13struct M { typedef double E; }; 14 15template <typename T> 16struct R 17{ 18 R() 19 { 20 typedef A<typename T::E> B; 21 B b; 22 #pragma omp parallel for firstprivate(b) schedule(guided) 23 for (int t = 0; t < 10; ++t) 24 ; 25 } 26}; 27 28template <typename T> 29struct S 30{ 31 S() 32 { 33 typedef C<typename T::E> B; 34 B b; 35 #pragma omp parallel for firstprivate(b) 36 for (int t = 0; t < 10; ++t) 37 ; 38 } 39}; 40 41struct U 42{ 43 U() 44 { 45 D b; 46 #pragma omp parallel for firstprivate(b) 47 for (int t = 0; t < 10; ++t) 48 ; 49 } 50}; 51 52int 53main () 54{ 55 R<M> r; 56 S<M> s; 57 U u; 58 return 0; 59} 60