Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++アウトラインでclass x final:base{}と:がfinalにくっついているとクラス名がfinalになる不具合の修正 #1612

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sakura_core/types/CType_Cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ void CDocOutline::MakeFuncList_C( CFuncInfoArr* pcFuncInfoArr ,EOutlineType& nOu
szItemName[0] = L'\0';
szTemplateName[0] = L'\0';
nMode = 0;

// finalで無名ではない
auto is_final_context = [](const wchar_t* pszWord, const wchar_t* pszItemName) {
return wcscmp(L"final", pszWord) == 0 && wcscmp(LS(STR_OUTLINE_CPP_NONAME), pszItemName) != 0;
};

// Aug. 10, 2004 genta プリプロセス処理クラス
CCppPreprocessMng cCppPMng;
Expand Down Expand Up @@ -586,7 +591,8 @@ void CDocOutline::MakeFuncList_C( CFuncInfoArr* pcFuncInfoArr ,EOutlineType& nOu
// class Klass:base のように:の前にスペースがない場合
if(nMode2 == M2_NAMESPACE_SAVE)
{
if(szWord[0]!='\0')
// 2021.3.27 class Klass final: public base{ の:だったら名前を上書きしない
if (szWord[0] != '\0' && !is_final_context(szWord, szItemName))
wcscpy( szItemName, szWord );
nMode2 = M2_NAMESPACE_END;
}
Expand All @@ -603,7 +609,7 @@ void CDocOutline::MakeFuncList_C( CFuncInfoArr* pcFuncInfoArr ,EOutlineType& nOu
}else{
// 2002/10/27 frozen ここから
if( nMode2 == M2_NAMESPACE_SAVE ){
if( wcscmp(L"final", szWord) == 0 && wcscmp(LS(STR_OUTLINE_CPP_NONAME), szItemName) != 0 ){
if(is_final_context(szWord, szItemName)){
// strcut name final のfinalはクラス名の一部ではない
// ただし struct finalは名前
}else{
Expand Down