Ignore:
Timestamp:
Sep 29, 2020, 1:51:01 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1526e86, 87b9332, 9dc3eb21
Parents:
2ff78aa (diff), d13dd6b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/typedefRedef.cfa

    r2ff78aa r08e8851  
    2727typedef int ARR[];
    2828typedef int ARR[];
    29 // #ifdef ERR1
    30 // if a typedef has an array dimension,
    31 // it can only be redefined to the same dimension
     29#ifdef ERR1
     30// if a typedef has an array dimension, it can only be redefined to the same dimension
    3231typedef int ARR[2];
    33 // #endif
     32#endif
    3433
    3534typedef int X;
     
    5453
    5554int main() {
    56   typedef int ARR[sz];
     55        typedef int ARR[sz];
    5756
    58   // can't redefine typedef which is VLA
     57        // can't redefine typedef which is VLA
    5958#if ERR1
    60   typedef int ARR[sz];
     59        typedef int ARR[sz];
    6160#endif
    6261
    63   Foo *x;
     62        Foo * x;
    6463
    65   typedef struct Bar Foo;
    66   Foo *y;
     64        typedef struct Bar Foo;
     65        Foo * y;
    6766
    68   typedef int *** pt;
     67        typedef int *** pt;
     68
     69        #pragma message( "Compiled" )                   // force non-empty .expect file
    6970}
Note: See TracChangeset for help on using the changeset viewer.