Changeset 683 in dev


Ignore:
Timestamp:
Jul 12, 2008, 11:30:50 PM (16 years ago)
Author:
dai_9181
Message:

#175への対応。型パラメータが値型のジェネリック型(テンプレート展開対象)を戻り値にした場合、戻り値用変数宣言がテンプレート展開前のクラスで行われてしまう不具合を修正。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp

    r672 r683  
    315315        return (std::string)"*" + TypeToString( tempType );
    316316    }
    317     else if( type.IsObject() || type.IsStruct() ){
     317    else if( type.IsObject() || type.IsStruct() )
     318    {
    318319        //オブジェクトまたは構造体
    319320
    320         if( !( type.GetIndex() == 0 || type.GetIndex() == -1 ) ){
     321        if( !( type.GetIndex() == 0 || type.GetIndex() == -1 ) )
     322        {
     323            std::string result = type.GetClass().GetName();
    321324            if( type.GetClass().GetNamespaceScopes().size() >= 1 )
    322325            {
    323                 return type.GetClass().GetNamespaceScopes().ToString() + "." + type.GetClass().GetName();
    324             }
    325             return type.GetClass().GetName();
     326                result = type.GetClass().GetNamespaceScopes().ToString()
     327                    + "."
     328                    + result;
     329            }
     330
     331            if( type.GetClass().IsExpanded() )
     332            {
     333                // テンプレート展開済みのクラスの場合
     334                std::string actualGenericTypesName;
     335                BOOST_FOREACH( const Type &typeParameter, type.GetClass().expandedClassActualTypeParameters )
     336                {
     337                    if( actualGenericTypesName.size() )
     338                    {
     339                        actualGenericTypesName += ",";
     340                    }
     341                    actualGenericTypesName += typeParameter.ToString();
     342                }
     343
     344                result += "<" + actualGenericTypesName + ">";
     345            }
     346
     347            return result;
    326348        }
    327349    }
Note: See TracChangeset for help on using the changeset viewer.