Changes in / [da9a27c:2aa25cc2]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rda9a27c r2aa25cc2  
    960960        }
    961961
    962         static bool isNonParameterAttribute( Attribute * attr ) {
    963                 static const std::vector<std::string> bad_names = {
    964                         "aligned", "__aligned__",
    965                 };
    966                 for ( auto name : bad_names ) {
    967                         if ( name == attr->name ) {
    968                                 return true;
    969                         }
    970                 }
    971                 return false;
    972         }
    973 
    974962        Type * ReplaceTypedef::postmutate( TypeInstType * typeInst ) {
    975963                // instances of typedef types will come here. If it is an instance
     
    980968                        ret->location = typeInst->location;
    981969                        ret->get_qualifiers() |= typeInst->get_qualifiers();
    982                         // GCC ignores certain attributes if they arrive by typedef, this mimics that.
    983                         if ( inFunctionType ) {
    984                                 ret->attributes.remove_if( isNonParameterAttribute );
    985                         }
    986                         ret->attributes.splice( ret->attributes.end(), typeInst->attributes );
     970                        // attributes are not carried over from typedef to function parameters/return values
     971                        if ( ! inFunctionType ) {
     972                                ret->attributes.splice( ret->attributes.end(), typeInst->attributes );
     973                        } else {
     974                                deleteAll( ret->attributes );
     975                                ret->attributes.clear();
     976                        }
    987977                        // place instance parameters on the typedef'd type
    988978                        if ( ! typeInst->parameters.empty() ) {
Note: See TracChangeset for help on using the changeset viewer.