The piece of code attached to this mail does not compile with 4.3.0 20070113
(sorry this is rather old, but that's what I had available). The
architecture (although not relevant IMHO)
is i686-pc-linux-gnu.
[ Even though this is not relevant here, a similar error happens with
the redhat version gcc-4.1.1 (although the message is slightly
different and more confusing). ]
I get the following error message:
-> g++ -fopenmp Test.C
Test.C: In constructor ‘R<M>::R()’:
Test.C:18: error: invalid use of incomplete type ‘struct R<M>::R()::B’
Test.C:9: error: declaration of ‘struct R<M>::R()::B’
I really do not see why R<M>::B is considered as an incomplete type at
this point (this seems related
to the use of "typename M::E", remove the template on M and everything
works fine).
Before cluttering the bug database, can someone confirm:
1) that indeed it looks like a bug (after all, I have been wrong
before... and I'm only starting with OpenMP),
2) that it still affects mainline.
I'll try to re-test with an up-to-date compiler tonigh (svn update in
progress, but that will take some time).
Thank's
// { dg-do compile }
// { dg-options "-fopenmp" }
//
// Copyright (C) 2007 Free Software Foundation, Inc.
// Contributed by Theodore.Papadopoulo 16 Apr 2007 <[EMAIL PROTECTED]>
#include <omp.h>
template <typename> struct A { A() {} };
struct M { typedef double E; };
template <typename M>
struct R{
R() {
typedef A<typename M::E> B;
B b;
#pragma omp parallel for firstprivate(b) schedule(guided)
for (int t=0;t<10;++t);
}
};
int
main() {
R<M> r;
return 0;
}