Compiler Error C3052
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C3052.
var' : variable doesn't appear in a data-sharing clause under a default(none) clause
If default(none) is used, any variable used in the structured block must be explicitly specified as either shared or private.
The following sample generates C3052:
// C3052.cpp
// compile with: /openmp /c
int main() {
int n1 = 1;
#pragma omp parallel default(none) // shared(n1) private(n1)
{
n1 = 0; // C3052 use either a shared or private clause
}
}
Show: