Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
__finally/finally without matching try
Remarks
A __finally or finally statement was found without a matching try. To resolve this, either delete the __finally statement or add a try statement for the __finally.
Example
The following example generates 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**");
}