Anmerkung
Der Zugriff auf diese Seite erfordert eine Genehmigung. Du kannst versuchen, dich anzumelden oder die Verzeichnisse zu wechseln.
Der Zugriff auf diese Seite erfordert eine Genehmigung. Du kannst versuchen , die Verzeichnisse zu wechseln.
'member': Nur ein Variable- oder statisches Datenmemmemm kann in einer Datenfreigabeklausel verwendet werden.
Bemerkungen
Ein anderes Symbol als eine Variable oder ein statisches Datenmemmemm wurde an die Reduktionsklausel übergeben.
Example
Im folgenden Beispiel wird C3028 generiert:
// C3028.cpp
// compile with: /openmp /link vcomps.lib
int g_i;
class MyClass {
public:
MyClass();
MyClass(int x);
static int x_public;
int mbr;
private:
static int x_private;
};
int MyClass::x_public;
int MyClass::x_private;
namespace XyzNS {
struct xyz { int x; };
xyz xyz;
}
namespace NS {
int a1;
struct Bar {
static MyClass MyClass;
};
struct Baz : public Bar {
using NS::Bar::MyClass;
};
}
MyClass NS::Bar::MyClass;
typedef int MyInt;
template <class T, size_t n> class CTempl {
public:
static T public_array[n];
private:
static T private_array[n];
};
template<class T,size_t n> T CTempl<T,n>::public_array[n];
template<class T,size_t n> T CTempl<T,n>::private_array[n];
CTempl<int,5> tx;
struct Incomplete;
extern Incomplete inc;
MyClass::MyClass(int x) {
#pragma omp parallel reduction(+: x, g_i, x_public, x_private)
// OK
;
#pragma omp parallel reduction(+: x, g_i, MyClass::x_public, MyClass::x_private)
// OK
;
#pragma omp parallel reduction(+: mbr)
// C3028, member of a class.
;
}
int main() {
#pragma omp parallel reduction(+:main)
// C3028, main is a function.
;
#pragma omp parallel reduction(+: XyzNS)
// C3028, XyzNS is a namespace.
;
}