This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36523] New: OpenMP task construct fails to instantiate copy constructor
- From: "singler at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2008 10:08:03 -0000
- Subject: [Bug c++/36523] New: OpenMP task construct fails to instantiate copy constructor
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following test case fails with a linker error. It compiles okay with the
pragma omp task line removed.
template<typename T>
struct A
{
A() { }
A(const A&) { }
void foo() { }
};
int main()
{
A<int> a;
#pragma omp task
a.foo();
return 0;
}
g++- -fopenmp -Wall task_instantiation.cpp
/tmp/ccQDTSgc.o: In function `main.omp_cpyfn.1':
task_instantiation.cpp:(.text+0x7e): undefined reference to `A<int>::A(A<int>
const&)'
collect2: ld returned 1 exit status
Workarounds:
-declare 'a' shared (mind data consistency)
-instantiate copy constructor explicitly
--
Summary: OpenMP task construct fails to instantiate copy
constructor
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: singler at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36523