Changeset 0a86a30 for src/SymTab


Ignore:
Timestamp:
Jan 27, 2017, 3:07:53 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
8804701, a362f97
Parents:
0157ca7
Message:

fix dropping attributes in function pointer decay and function typedefs

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/FixFunction.cc

    r0157ca7 r0a86a30  
    2525
    2626        DeclarationWithType * FixFunction::mutate(FunctionDecl *functionDecl) {
    27                 ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 );
     27                ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0, functionDecl->get_attributes() );
     28                functionDecl->get_attributes().clear();
    2829                delete functionDecl;
    2930                return pointer;
  • src/SymTab/Validate.cc

    r0157ca7 r0a86a30  
    637637                if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) {
    638638                        // replace the current object declaration with a function declaration
    639                         return new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, ret->get_isInline(), ret->get_isNoreturn() );
     639                        FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, ret->get_isInline(), ret->get_isNoreturn(), objDecl->get_attributes() );
     640                        objDecl->get_attributes().clear();
     641                        delete objDecl;
     642                        return newDecl;
    640643                } else if ( objDecl->get_isInline() || objDecl->get_isNoreturn() ) {
    641644                        throw SemanticError( "invalid inline or _Noreturn specification in declaration of ", objDecl );
Note: See TracChangeset for help on using the changeset viewer.