clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
17 stars 5 forks source link

[SPEC 1.3] Diagnose [*] in typedefs as an error for static threads #17

Closed gary-funck closed 11 years ago

gary-funck commented 11 years ago

The UPC 1.3 Specification states that an automatic layout qualifier ([]) are invalid and should issue an error diagnostic. GUPC currently will issue an error for dynamic threads, but will attempt to evaluate [] for static threads. http://code.google.com/p/upc-specification/issues/detail?id=71 [^]

Clang UPC should diagnose '[*]' as an error for static threads compilations.

gary-funck commented 11 years ago

Here is a test case. It must be compiled with a compile-time value of THREADS.

// Tester for "issue 71" compliance: no [*] in typedefs
// Copyright 2013, The Regents of the University of California,
// through Lawrence Berkeley National Laboratory (subject to
// receipt of any required approvals from U.S. Dept. of Energy)
// See the full license terms at
//       http://upc.lbl.gov/download/dist/LICENSE.TXT

// The following is prohibited:
typedef shared [*] int int_type;
int_type arr[3*THREADS];

int main(void) {
  arr[0] = 0; // ensure arr (and thus int_type) don't get discarded
  return 0;
}