Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rf7e4db27 rdea36ee  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 20 11:46:46 2018
    13 // Update Count     : 3837
     12// Last Modified On : Thu Jul 19 22:21:56 2018
     13// Update Count     : 3827
    1414//
    1515
     
    172172        return new_name;
    173173} // build_postfix_name
    174 
    175 DeclarationNode * fieldDecl( DeclarationNode * typeSpec, DeclarationNode * fieldList ) {
    176         if ( ! fieldList ) {                                                            // field declarator ?
    177                 if ( ! ( typeSpec->type && typeSpec->type->kind == TypeData::Aggregate ) ) {
    178                         stringstream ss;
    179                         typeSpec->type->print( ss );
    180                         SemanticWarning( yylloc, Warning::SuperfluousDecl, ss.str().c_str() );
    181                         return nullptr;
    182                 } // if
    183                 fieldList = DeclarationNode::newName( nullptr );
    184         } // if
    185         return distAttr( typeSpec, fieldList );                         // mark all fields in list
    186 } // fieldDecl
    187174
    188175bool forall = false, yyy = false;                                               // aggregate have one or more forall qualifiers ?
     
    19551942field_declaration:
    19561943        type_specifier field_declaring_list_opt ';'
    1957                 { $$ = fieldDecl( $1, $2 ); }
     1944                {
     1945                        if ( ! $2 ) {                                                           // field declarator ?
     1946                                $2 = DeclarationNode::newName( nullptr );
     1947                                if ( ! ( $1->type && $1->type->kind == TypeData::Aggregate ) ) {
     1948                                        SemanticWarning( yylloc, Warning::SuperfluousDecl, "" );
     1949                                } // if
     1950                        } // if
     1951                        $$ = distAttr( $1, $2 );                                        // mark all fields in list
     1952                }
    19581953        | EXTENSION type_specifier field_declaring_list_opt ';' // GCC
    1959                 { $$ = fieldDecl( $2, $3 ); distExt( $$ ); }
     1954                {
     1955                        if ( ! $3 ) {                                                           // field declarator ?
     1956                                $3 = DeclarationNode::newName( nullptr );
     1957                                if ( ! ( $2->type && $2->type->kind == TypeData::Aggregate ) ) {
     1958                                        SemanticWarning( yylloc, Warning::SuperfluousDecl, "" );
     1959                                } // if
     1960                        } // if
     1961                        $$ = distAttr( $2, $3 );                                        // mark all fields in list
     1962                        distExt( $$ );
     1963                }
    19601964        | INLINE type_specifier field_abstract_list_opt ';'     // CFA
    19611965                {
     
    20052009
    20062010field_abstract:
    2007                 //      no bit fields
     2011        //      no bit fields
    20082012        variable_abstract_declarator
    20092013        ;
    20102014
    20112015cfa_field_declaring_list:                                                               // CFA, new style field declaration
    2012         // bit-fields are handled by C declarations
    20132016        cfa_abstract_declarator_tuple no_attr_identifier_or_type_name
    20142017                { $$ = $1->addName( $2 ); }
     
    20182021
    20192022cfa_field_abstract_list:                                                                // CFA, new style field declaration
    2020         // bit-fields are handled by C declarations
    20212023        cfa_abstract_declarator_tuple
    20222024        | cfa_field_abstract_list ','
Note: See TracChangeset for help on using the changeset viewer.