Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.cc

    r0cb1d61 rafc1045  
    511511        }
    512512
    513         bool Indexer::hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const {
     513        bool Indexer::hasIncompatibleCDecl( const std::string &id, const std::string &mangleName ) const {
    514514                if ( ! tables ) return false;
    515                 if ( tables->scope < scope ) return false;
    516515
    517516                IdTable::const_iterator decls = tables->idTable.find( id );
     
    525524                }
    526525
    527                 return tables->base.hasIncompatibleCDecl( id, mangleName, scope );
     526                return tables->base.hasIncompatibleCDecl( id, mangleName );
    528527        }
    529528       
     
    618617                DeclarationWithType *existing = lookupIdAtScope( name, mangleName, scope );
    619618                if ( ! existing || ! addedIdConflicts( existing, decl ) ) {
    620                         // this ensures that no two declarations with the same unmangled name at the same scope both have C linkage
    621                         if ( decl->get_linkage() == LinkageSpec::C && hasIncompatibleCDecl( name, mangleName, scope ) ) {
     619                        // this ensures that no two declarations with the same unmangled name both have C linkage
     620                        if ( decl->get_linkage() == LinkageSpec::C && hasIncompatibleCDecl( name, mangleName ) ) {
    622621                                throw SemanticError( "invalid overload of C function ", decl );
    623622                        } // NOTE this is broken in Richard's original code in such a way that it never triggers (it
     
    784783            using std::cerr;
    785784
    786                 if ( tables ) {
    787                         os << "--- scope " << tables->scope << " ---" << std::endl;
    788 
    789                         os << "===idTable===" << std::endl;
    790                         dump( tables->idTable, os );
    791                         os << "===typeTable===" << std::endl;
    792                         dump( tables->typeTable, os );
    793                         os << "===structTable===" << std::endl;
    794                         dump( tables->structTable, os );
    795                         os << "===enumTable===" << std::endl;
    796                         dump( tables->enumTable, os );
    797                         os << "===unionTable===" << std::endl;
    798                         dump( tables->unionTable, os );
    799                         os << "===contextTable===" << std::endl;
    800                         dump( tables->traitTable, os );
    801 
    802                         tables->base.print( os, indent );
    803                 } else {
    804                         os << "--- end ---" << std::endl;
    805                 }
    806                
     785            cerr << "===idTable===" << std::endl;
     786            if ( tables ) dump( tables->idTable, os );
     787            cerr << "===typeTable===" << std::endl;
     788            if ( tables ) dump( tables->typeTable, os );
     789            cerr << "===structTable===" << std::endl;
     790            if ( tables ) dump( tables->structTable, os );
     791            cerr << "===enumTable===" << std::endl;
     792            if ( tables ) dump( tables->enumTable, os );
     793            cerr << "===unionTable===" << std::endl;
     794            if ( tables ) dump( tables->unionTable, os );
     795            cerr << "===contextTable===" << std::endl;
     796            if ( tables ) dump( tables->traitTable, os );
    807797        }
    808798} // namespace SymTab
Note: See TracChangeset for help on using the changeset viewer.