Changes in / [46aa60e:1761046]


Ignore:
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/lstlang.sty

    r46aa60e r1761046  
    88%% Created On       : Sat May 13 16:34:42 2017
    99%% Last Modified By : Peter A. Buhr
    10 %% Last Modified On : Fri Feb 16 07:59:29 2024
    11 %% Update Count     : 37
     10%% Last Modified On : Tue Feb 13 13:27:00 2024
     11%% Update Count     : 36
    1212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1313
     
    125125}
    126126
     127% C++ programming language
     128\lstdefinelanguage{C++}[ANSI]{C++}{
     129        morekeywords={nullptr,}
     130}
     131
    127132% uC++ programming language, based on ANSI C++
    128 \lstdefinelanguage{uC++}[GNU]{C++}{
     133\lstdefinelanguage{uC++}[ANSI]{C++}{
    129134        morekeywords={
    130135                _Accept, _AcceptReturn, _AcceptWait, _Actor, _At, _Catch, _CatchResume, _CorActor, _Cormonitor, _Coroutine,
  • src/AST/Attribute.hpp

    r46aa60e r1761046  
    99// Author           : Aaron B. Moss
    1010// Created On       : Fri May 10 10:30:00 2019
    11 // Last Modified By : Peter A. Buhr
     11// Last Modified By : Aaron B. Moss
    1212// Created On       : Fri May 10 10:30:00 2019
    13 // Update Count     : 2
     13// Update Count     : 1
    1414//
    1515
     
    3434
    3535        Attribute( const std::string & name = "", std::vector<ptr<Expr>> && params = {})
    36                 : name( name ), params( params ) {}
     36        : name( name ), params( params ) {}
    3737        virtual ~Attribute() = default;
    3838
  • src/Parser/DeclarationNode.cc

    r46aa60e r1761046  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb 23 18:25:57 2024
    13 // Update Count     : 1533
     12// Last Modified On : Thu Dec 14 19:05:17 2023
     13// Update Count     : 1407
    1414//
    1515
     
    159159
    160160        if ( ! attributes.empty() ) {
    161                 os << string( indent + 2, ' ' ) << "with attributes" << endl;
     161                os << string( indent + 2, ' ' ) << "with attributes " << endl;
    162162                for ( ast::ptr<ast::Attribute> const & attr : reverseIterate( attributes ) ) {
    163                         os << string( indent + 4, ' ' );
    164                         ast::print( os, attr, indent + 2 );
     163                        os << string( indent + 4, ' ' ) << attr->name.c_str() << endl;
    165164                } // for
    166165        } // if
     
    538537} // DeclarationNode::checkSpecifiers
    539538
    540 DeclarationNode * DeclarationNode::copySpecifiers( DeclarationNode * q, bool copyattr ) {
     539DeclarationNode * DeclarationNode::copySpecifiers( DeclarationNode * q ) {
    541540        funcSpecs |= q->funcSpecs;
    542541        storageClasses |= q->storageClasses;
    543542
    544         if ( copyattr ) {
    545                 std::vector<ast::ptr<ast::Attribute>> tmp;
    546                 tmp.reserve( q->attributes.size() );
    547                 for ( auto const & attr : q->attributes ) {
    548                         tmp.emplace_back( ast::shallowCopy( attr.get() ) );
    549                 } // for
    550                 spliceBegin( attributes, tmp );
    551         } // if
     543        std::vector<ast::ptr<ast::Attribute>> tmp;
     544        tmp.reserve( q->attributes.size() );
     545        for ( auto const & attr : q->attributes ) {
     546                tmp.emplace_back( ast::shallowCopy( attr.get() ) );
     547        }
     548        spliceBegin( attributes, tmp );
    552549
    553550        return this;
     
    684681}
    685682
    686 DeclarationNode * DeclarationNode::addType( DeclarationNode * o, bool copyattr ) {
     683DeclarationNode * DeclarationNode::addType( DeclarationNode * o ) {
    687684        if ( o ) {
    688685                checkSpecifiers( o );
    689                 copySpecifiers( o, copyattr );
     686                copySpecifiers( o );
    690687                if ( o->type ) {
    691688                        if ( ! type ) {
    692689                                if ( o->type->kind == TypeData::Aggregate || o->type->kind == TypeData::Enum ) {
    693                                         // Hide type information aggregate instances.
    694690                                        type = new TypeData( TypeData::AggregateInst );
    695                                         type->aggInst.aggregate = o->type;      // change ownership
    696                                         type->aggInst.aggregate->aggregate.attributes.swap( o->attributes ); // change ownership                                       
     691                                        type->aggInst.aggregate = o->type;
    697692                                        if ( o->type->kind == TypeData::Aggregate ) {
    698693                                                type->aggInst.hoistType = o->type->aggregate.body;
     
    705700                                        type = o->type;
    706701                                } // if
    707                                 o->type = nullptr;                                              // change ownership
     702                                o->type = nullptr;
    708703                        } else {
    709704                                addTypeToType( o->type, type );
     
    958953}
    959954
    960 DeclarationNode * DeclarationNode::cloneBaseType( DeclarationNode * o, bool copyattr ) {
     955DeclarationNode * DeclarationNode::cloneBaseType( DeclarationNode * o ) {
    961956        if ( ! o ) return nullptr;
    962957
    963         o->copySpecifiers( this, copyattr );
     958        o->copySpecifiers( this );
    964959        if ( type ) {
    965960                TypeData * srcType = type;
     
    1004999                        DeclarationNode * newnode = new DeclarationNode;
    10051000                        newnode->type = ret;
    1006                         if ( ret->kind == TypeData::Aggregate ) {
    1007                                 newnode->attributes.swap( ret->aggregate.attributes );
    1008                         } // if
    10091001                        return newnode;
    10101002                } // if
     
    11181110                                        if ( extr->type->kind == TypeData::Aggregate ) {
    11191111                                                // typedef struct { int A } B is the only case?
    1120                                                 extracted_named = ! extr->type->aggregate.anon;
     1112                                                extracted_named = !extr->type->aggregate.anon;
    11211113                                        } else if ( extr->type->kind == TypeData::Enum ) {
    11221114                                                // typedef enum { A } B is the only case?
    1123                                                 extracted_named = ! extr->type->enumeration.anon;
     1115                                                extracted_named = !extr->type->enumeration.anon;
    11241116                                        } else {
    11251117                                                extracted_named = true;
  • src/Parser/DeclarationNode.h

    r46aa60e r1761046  
    99// Author           : Andrew Beach
    1010// Created On       : Wed Apr  5 11:38:00 2023
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 17 09:24:12 2024
    13 // Update Count     : 4
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Apr  5 11:55:00 2023
     13// Update Count     : 0
    1414//
    1515
     
    8383        void checkQualifiers( const TypeData *, const TypeData * );
    8484        void checkSpecifiers( DeclarationNode * );
    85         DeclarationNode * copySpecifiers( DeclarationNode *, bool = true );
    86         DeclarationNode * addType( DeclarationNode *, bool = true );
     85        DeclarationNode * copySpecifiers( DeclarationNode * );
     86        DeclarationNode * addType( DeclarationNode * );
    8787        DeclarationNode * addTypedef();
    8888        DeclarationNode * addEnumBase( DeclarationNode * );
     
    106106
    107107        DeclarationNode * cloneType( std::string * newName );
    108         DeclarationNode * cloneBaseType( DeclarationNode * newdecl, bool = true );
     108        DeclarationNode * cloneBaseType( DeclarationNode * newdecl );
    109109
    110110        DeclarationNode * appendList( DeclarationNode * node ) {
  • src/Parser/TypeData.cc

    r46aa60e r1761046  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb 23 08:58:30 2024
    13 // Update Count     : 734
     12// Last Modified On : Thu Dec 14 18:59:12 2023
     13// Update Count     : 684
    1414//
    1515
     
    2020
    2121#include "AST/Decl.hpp"            // for AggregateDecl, ObjectDecl, TypeDe...
    22 #include "AST/Attribute.hpp"       // for Attribute
    2322#include "AST/Init.hpp"            // for SingleInit, ListInit
    2423#include "AST/Print.hpp"           // for print
    2524#include "Common/SemanticError.h"  // for SemanticError
    2625#include "Common/utility.h"        // for splice, spliceBegin
    27 #include "Common/Iterate.hpp"      // for reverseIterate
    2826#include "Parser/ExpressionNode.h" // for ExpressionNode
    2927#include "Parser/StatementNode.h"  // for StatementNode
     
    201199                newtype->aggregate.kind = aggregate.kind;
    202200                newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr;
    203                 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr;
    204201                newtype->aggregate.params = maybeCopy( aggregate.params );
    205202                newtype->aggregate.actuals = maybeCopy( aggregate.actuals );
    206203                newtype->aggregate.fields = maybeCopy( aggregate.fields );
    207                 newtype->aggregate.attributes = aggregate.attributes;
    208204                newtype->aggregate.body = aggregate.body;
    209205                newtype->aggregate.anon = aggregate.anon;
    210206                newtype->aggregate.tagged = aggregate.tagged;
     207                newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr;
    211208                break;
    212209        case AggregateInst:
     
    339336                } // if
    340337                if ( aggregate.body ) {
    341                         os << string( indent + 2, ' ' ) << "with body" << endl;
    342                 } // if
    343                 if ( ! aggregate.attributes.empty() ) {
    344                         os << string( indent + 2, ' ' ) << "with attributes" << endl;
    345                         for ( ast::ptr<ast::Attribute> const & attr : reverseIterate( aggregate.attributes ) ) {
    346                                 os << string( indent + 4, ' ' );
    347                                 ast::print( os, attr, indent + 2 );
    348                         } // for
     338                        os << string( indent + 2, ' ' ) << " with body" << endl;
    349339                } // if
    350340                break;
     
    368358                } // if
    369359                if ( enumeration.body ) {
    370                         os << string( indent + 2, ' ' ) << "with body" << endl;
     360                        os << string( indent + 2, ' ' ) << " with body" << endl;
    371361                } // if
    372362                if ( base ) {
     
    10981088
    10991089ast::BaseInstType * buildComAggInst(
    1100                 const TypeData * td,
     1090                const TypeData * type,
    11011091                std::vector<ast::ptr<ast::Attribute>> && attributes,
    11021092                ast::Linkage::Spec linkage ) {
    1103         switch ( td->kind ) {
     1093        switch ( type->kind ) {
    11041094        case TypeData::Enum:
    1105                 if ( td->enumeration.body ) {
     1095                if ( type->enumeration.body ) {
    11061096                        ast::EnumDecl * typedecl =
    1107                                 buildEnum( td, std::move( attributes ), linkage );
     1097                                buildEnum( type, std::move( attributes ), linkage );
    11081098                        return new ast::EnumInstType(
    11091099                                typedecl,
    1110                                 buildQualifiers( td )
     1100                                buildQualifiers( type )
    11111101                        );
    11121102                } else {
    11131103                        return new ast::EnumInstType(
    1114                                 *td->enumeration.name,
    1115                                 buildQualifiers( td )
     1104                                *type->enumeration.name,
     1105                                buildQualifiers( type )
    11161106                        );
    11171107                } // if
    11181108                break;
    11191109        case TypeData::Aggregate:
    1120                 if ( td->aggregate.body ) {
     1110                if ( type->aggregate.body ) {
    11211111                        ast::AggregateDecl * typedecl =
    1122                                 buildAggregate( td, std::move( attributes ), linkage );
    1123                         switch ( td->aggregate.kind ) {
     1112                                buildAggregate( type, std::move( attributes ), linkage );
     1113                        switch ( type->aggregate.kind ) {
    11241114                        case ast::AggregateDecl::Struct:
    11251115                        case ast::AggregateDecl::Coroutine:
     
    11281118                                return new ast::StructInstType(
    11291119                                        strict_dynamic_cast<ast::StructDecl *>( typedecl ),
    1130                                         buildQualifiers( td )
     1120                                        buildQualifiers( type )
    11311121                                );
    11321122                        case ast::AggregateDecl::Union:
    11331123                                return new ast::UnionInstType(
    11341124                                        strict_dynamic_cast<ast::UnionDecl *>( typedecl ),
    1135                                         buildQualifiers( td )
     1125                                        buildQualifiers( type )
    11361126                                );
    11371127                        case ast::AggregateDecl::Trait:
     
    11421132                        } // switch
    11431133                } else {
    1144                         switch ( td->aggregate.kind ) {
     1134                        switch ( type->aggregate.kind ) {
    11451135                        case ast::AggregateDecl::Struct:
    11461136                        case ast::AggregateDecl::Coroutine:
     
    11481138                        case ast::AggregateDecl::Thread:
    11491139                                return new ast::StructInstType(
    1150                                         *td->aggregate.name,
    1151                                         buildQualifiers( td )
     1140                                        *type->aggregate.name,
     1141                                        buildQualifiers( type )
    11521142                                );
    11531143                        case ast::AggregateDecl::Union:
    11541144                                return new ast::UnionInstType(
    1155                                         *td->aggregate.name,
    1156                                         buildQualifiers( td )
     1145                                        *type->aggregate.name,
     1146                                        buildQualifiers( type )
    11571147                                );
    11581148                        case ast::AggregateDecl::Trait:
    11591149                                return new ast::TraitInstType(
    1160                                         *td->aggregate.name,
    1161                                         buildQualifiers( td )
     1150                                        *type->aggregate.name,
     1151                                        buildQualifiers( type )
    11621152                                );
    11631153                        default:
  • src/Parser/TypeData.h

    r46aa60e r1761046  
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat May 16 15:18:36 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 22 16:30:31 2024
    13 // Update Count     : 210
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Mar  1 10:44:00 2023
     13// Update Count     : 206
    1414//
    1515
     
    3030                ast::AggregateDecl::Aggregate kind;
    3131                const std::string * name = nullptr;
    32                 const std::string * parent = nullptr;
    3332                DeclarationNode * params = nullptr;
    3433                ExpressionNode * actuals = nullptr;                             // holds actual parameters later applied to AggInst
    3534                DeclarationNode * fields = nullptr;
    36                 std::vector<ast::ptr<ast::Attribute>> attributes;
    3735                bool body;
    3836                bool anon;
    3937                bool tagged;
     38                const std::string * parent = nullptr;
    4039        };
    4140
  • src/Parser/parser.yy

    r46aa60e r1761046  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb 23 18:25:46 2024
    13 // Update Count     : 6484
     12// Last Modified On : Sun Nov 26 13:18:06 2023
     13// Update Count     : 6398
    1414//
    1515
     
    102102
    103103DeclarationNode * distAttr( DeclarationNode * typeSpec, DeclarationNode * declList ) {
    104         // Distribute type specifier across all declared variables, e.g., static, const, __attribute__.
     104        // distribute declaration_specifier across all declared variables, e.g., static, const, but not __attribute__.
    105105        assert( declList );
    106 
    107         // Do not distribute attributes for aggregates because the attributes surrounding the aggregate belong it not the
    108         // variables in the declaration list, e.g.,
    109         //
    110         //   struct __attribute__(( aligned(128) )) S { ...
    111         //   } v1 __attribute__(( aligned(64) )), v2 __attribute__(( aligned(32) )), v3;
    112         //   struct S v4;
    113         //
    114         // v1 => 64, v2 =>32, v3 => 128, v2 => 128
    115         //
    116         // Anonymous aggregates are a special case because there is no aggregate to bind the attribute to; hence it floats
    117         // to the declaration list.
    118         //
    119         //   struct __attribute__(( aligned(128) )) /*anonymous */ { ... } v1;
    120         //
    121         // v1 => 128
    122 
    123         bool copyattr = ! (typeSpec->type && typeSpec->type->kind == TypeData::Aggregate && ! typeSpec->type->aggregate.anon );
    124 
    125         // addType copies the type information for the aggregate instances from typeSpec into cl's aggInst.aggregate.
    126         DeclarationNode * cl = (new DeclarationNode)->addType( typeSpec ); // typeSpec IS DELETED!!!
    127 
    128         // Start at second variable in declaration list and clone the type specifiers for each variable..
     106        // printf( "distAttr1 typeSpec %p\n", typeSpec ); typeSpec->print( std::cout );
     107        DeclarationNode * cl = (new DeclarationNode)->addType( typeSpec );
     108        // printf( "distAttr2 cl %p\n", cl ); cl->type->print( std::cout );
     109        // cl->type->aggregate.name = cl->type->aggInst.aggregate->aggregate.name;
     110
    129111        for ( DeclarationNode * cur = dynamic_cast<DeclarationNode *>( declList->get_next() ); cur != nullptr; cur = dynamic_cast<DeclarationNode *>( cur->get_next() ) ) {
    130                 cl->cloneBaseType( cur, copyattr );                             // cur is modified
     112                cl->cloneBaseType( cur );
    131113        } // for
    132 
    133         // Add first variable in declaration list with hidden type information in aggInst.aggregate, which is used by
    134         // extractType to recover the type for the aggregate instances.
    135         declList->addType( cl, copyattr );                                      // cl IS DELETED!!!
     114        declList->addType( cl );
     115        // printf( "distAttr3 declList %p\n", declList ); declList->print( std::cout, 0 );
    136116        return declList;
    137117} // distAttr
     
    212192                fieldList = DeclarationNode::newName( nullptr );
    213193        } // if
     194//      return distAttr( typeSpec, fieldList );                         // mark all fields in list
    214195
    215196        // printf( "fieldDecl3 typeSpec %p\n", typeSpec ); typeSpec->print( std::cout, 0 );
    216         DeclarationNode * temp = distAttr( typeSpec, fieldList ); // mark all fields in list
     197        DeclarationNode * temp = distAttr( typeSpec, fieldList );                               // mark all fields in list
    217198        // printf( "fieldDecl4 temp %p\n", temp ); temp->print( std::cout, 0 );
    218199        return temp;
     
    780761        | string_literal '`' identifier                                         // CFA, postfix call
    781762                { $$ = new ExpressionNode( build_func( yylloc, new ExpressionNode( build_varref( yylloc, build_postfix_name( $3 ) ) ), $1 ) ); }
    782 
    783                 // SKULLDUGGERY: The typedef table used for parsing does not store fields in structures. To parse a qualified
    784                 // name, it is assumed all name-tokens after the first are identifiers, regardless of how the lexer identifies
    785         // them. For example:
    786                 //   
    787                 //   struct S;
    788                 //   forall(T) struct T;
    789                 //   union U;
    790                 //   enum E { S, T, E };
    791                 //   struct Z { int S, T, Z, E, U; };
    792                 //   void fred () {
    793                 //       Z z;
    794                 //       z.S;  // lexer returns S is TYPEDEFname
    795                 //       z.T;  // lexer returns T is TYPEGENname
    796                 //       z.Z;  // lexer returns Z is TYPEDEFname
    797                 //       z.U;  // lexer returns U is TYPEDEFname
    798                 //       z.E;  // lexer returns E is TYPEDEFname
    799                 //   }
    800763        | postfix_expression '.' identifier
    801764                { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }
    802         | postfix_expression '.' TYPEDEFname                            // CFA, SKULLDUGGERY
    803                 { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }
    804         | postfix_expression '.' TYPEGENname                            // CFA, SKULLDUGGERY
    805                 { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }
    806 
    807765        | postfix_expression '.' INTEGERconstant                        // CFA, tuple index
    808766                { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_constantInteger( yylloc, *$3 ) ) ); }
     
    18971855declaration_list:
    18981856        declaration
    1899         | declaration_list declaration          { $$ = $1->appendList( $2 ); }
     1857        | declaration_list declaration
     1858                { $$ = $1->appendList( $2 ); }
    19001859        ;
    19011860
     
    19301889declaration:                                                                                    // old & new style declarations
    19311890        c_declaration ';'
     1891                {
     1892                        // printf( "C_DECLARATION1 %p %s\n", $$, $$->name ? $$->name->c_str() : "(nil)" );
     1893                        // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {
     1894                        //   printf( "\tattr %s\n", attr->name.c_str() );
     1895                        // } // for
     1896                }
    19321897        | cfa_declaration ';'                                                           // CFA
    19331898        | static_assert                                                                         // C11
     
    23822347sue_declaration_specifier:                                                              // struct, union, enum + storage class + type specifier
    23832348        sue_type_specifier
     2349                {
     2350                        // printf( "sue_declaration_specifier %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" );
     2351                        // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {
     2352                        //   printf( "\tattr %s\n", attr->name.c_str() );
     2353                        // } // for
     2354                }
    23842355        | declaration_qualifier_list sue_type_specifier
    23852356                { $$ = $2->addQualifiers( $1 ); }
     
    23922363sue_type_specifier:                                                                             // struct, union, enum + type specifier
    23932364        elaborated_type
     2365                {
     2366                        // printf( "sue_type_specifier %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" );
     2367                        // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {
     2368                        //   printf( "\tattr %s\n", attr->name.c_str() );
     2369                        // } // for
     2370                }
    23942371        | type_qualifier_list
    23952372                { if ( $1->type != nullptr && $1->type->forall ) forall = true; } // remember generic type
     
    24642441elaborated_type:                                                                                // struct, union, enum
    24652442        aggregate_type
     2443                {
     2444                        // printf( "elaborated_type %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" );
     2445                        // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {
     2446                        //   printf( "\tattr %s\n", attr->name.c_str() );
     2447                        // } // for
     2448                }
    24662449        | enum_type
    24672450        ;
     
    26952678                { $$ = DeclarationNode::newEnum( nullptr, $4, true, false )->addQualifiers( $2 ); }
    26962679        | ENUM attribute_list_opt '!' '{' enumerator_list comma_opt '}' // invalid syntax rule
    2697                 { SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
     2680                { SemanticError( yylloc, "syntax error, hiding '!' the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
    26982681        | ENUM attribute_list_opt identifier
    26992682                { typedefTable.makeTypedef( *$3, "enum_type 1" ); }
     
    27102693                }
    27112694        | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '!' '{' enumerator_list comma_opt '}' // unqualified type name
    2712                 { SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
     2695                { SemanticError( yylloc, "syntax error, hiding '!' the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
    27132696        | ENUM '(' ')' attribute_list_opt '{' enumerator_list comma_opt '}'
    27142697                {
     
    27162699                }
    27172700        | ENUM '(' ')' attribute_list_opt '!' '{' enumerator_list comma_opt '}' // invalid syntax rule
    2718                 { SemanticError( yylloc, "syntax error, hiding ('!') the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
     2701                { SemanticError( yylloc, "syntax error, hiding '!' the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }
    27192702        | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt
    27202703                {
     
    31873170                        // unit, which is a dubious task, especially because C uses name rather than structural typing; hence it is
    31883171                        // disallowed at the moment.
    3189                         if ( $1->linkage == ast::Linkage::Cforall && ! $1->storageClasses.is_static &&
    3190                                  $1->type && $1->type->kind == TypeData::AggregateInst ) {
     3172                        if ( $1->linkage == ast::Linkage::Cforall && ! $1->storageClasses.is_static && $1->type && $1->type->kind == TypeData::AggregateInst ) {
    31913173                                if ( $1->type->aggInst.aggregate->kind == TypeData::Enum && $1->type->aggInst.aggregate->enumeration.anon ) {
    31923174                                        SemanticError( yylloc, "extern anonymous enumeration is currently unimplemented." ); $$ = nullptr;
  • tests/.expect/attributes.x64.txt

    r46aa60e r1761046  
    66
    77}
    8 struct __attribute__ ((unused)) __anonymous0 {
     8struct __anonymous0 {
    99};
    1010static inline void _X12_constructorFv_S12__anonymous0_autogen___1(struct __anonymous0 *_X4_dstS12__anonymous0_1);
  • tests/errors/.expect/declaration.txt

    r46aa60e r1761046  
    88  with members
    99    i: int
    10   with body
     10   with body
    1111
    1212
     
    1414  with members
    1515    i: int
    16   with body
     16   with body
    1717
    1818
Note: See TracChangeset for help on using the changeset viewer.