Ignore:
Timestamp:
Jul 6, 2018, 9:45:43 AM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
a1cfa0c, ac4ebc1
Parents:
57fc7d8
Message:

cleanup, fix distribution order, add generic declaration/instantiation, extra qualifier check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r57fc7d8 r284da8c  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  7 12:08:55 2018
    13 // Update Count     : 1079
     12// Last Modified On : Fri Jul  6 06:56:08 2018
     13// Update Count     : 1088
    1414//
    1515
     
    504504
    505505static void addQualifiersToType( TypeData *&src, TypeData * dst ) {
    506         if ( src->forall && dst->kind == TypeData::Function ) {
    507                 if ( dst->forall ) {
    508                         dst->forall->appendList( src->forall );
    509                 } else {
    510                         dst->forall = src->forall;
    511                 } // if
    512                 src->forall = nullptr;
    513         } // if
    514506        if ( dst->base ) {
    515507                addQualifiersToType( src, dst->base );
     
    10651057                        SemanticError( this, "invalid function specifier for " );
    10661058                } // if
     1059                // Forall qualifier can only appear on a function/aggregate definition/declaration.
     1060                //
     1061                //    forall int f();                                   // allowed
     1062                //    forall int g( int i );                    // allowed
     1063                //    forall int i;                                             // disallowed
     1064                if ( type->kind != TypeData::Function && type->forall ) {
     1065                        SemanticError( this, "invalid type qualifier for " );
     1066                } // if
    10671067                bool isDelete = initializer && initializer->get_isDelete();
    10681068                Declaration * decl = buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, isDelete ? nullptr : maybeBuild< Initializer >(initializer), attributes )->set_extension( extension );
Note: See TracChangeset for help on using the changeset viewer.