Ticket #23 (defect)
Opened 1 year ago
Last modified 1 year ago
declarators3_neg intends to check for "shared" in auto scope, but tests "shared" on params instead
Status: closed (fixed)
| Reported by: | gary | Assigned to: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | component1 | Version: | 1.0 |
| Keywords: | guts | Cc: | |
declarators3_neg gives the following results:
--------------> Working on unit -- declarators3_neg\n declarators3_neg.upc:37: error: parameter `a' declared with shared qualifier declarators3_neg.upc:55: error: parameter `b' declared with shared qualifier Compilation was UNSUCCESSFUL for the negative unit [declarators3_neg] Note that this is the EXPECTED result since the unit is negative The unit will not be run!!! TEST PASSED for the unit [declarators3_neg]
Although the program is in error, it doesn't test the situation that the comments indicate it is trying to test.
36 /* This function definition is not valid because of shared type declaration in function context */
37 int foo(shared int a);
38
39 shared int b;
40
41 int main()
42 {
43 /*
44 * To check that "shared" can not appear in a declarator which has
45 * automatic storage duration, unless it qualifies a pointer type
46 * compiler must report an ERROR here !!!
47 */
48
49 int a;
50 a = foo(b);
51
52 return 0;
53 }
54
55 int foo(shared int b){
56 return 0;
57 }
Technically, 'a' and 'b' are parameters and are not auto scoped.
Change History
10/14/07 05:29:34: Modified by apokayi
- status changed from new to closed.
- resolution set to fixed.

/* This function definition is not valid because of shared type declaration in function context */ int foo(){
new function foo() reflects the intended test case