Edit

Share via


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
   }
}