__finally/finally 缺少對應的 try
備註
找到缺少對應之 的 __finally 或 finally try陳述式。 若要解決這個問題,請刪除 __finally 陳述式,或為 try 加入 __finally陳述式。
Example
下列範例會產生 C3274:
// C3274.cpp
// compile with: /clr
// C3274 expected
using namespace System;
int main() {
try {
try {
throw gcnew ApplicationException();
}
catch(...) {
Console::Error->WriteLine(L"Caught an exception");
}
finally {
Console::WriteLine(L"In finally");
}
} finally {
Console::WriteLine(L"In finally");
}
// Uncomment the following 3 lines to resolve.
// try {
// throw gcnew ApplicationException();
// }
finally {
Console::WriteLine(L"In finally");
}
Console::WriteLine(L"**FAIL**");
}