Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 778 Bytes

compiler-warning-level-1-c4286.md

File metadata and controls

32 lines (28 loc) · 778 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4286
Compiler Warning (level 1) C4286
11/04/2016
C4286
C4286
93eadd6c-6f36-413b-ba91-c9aa2314685a

Compiler Warning (level 1) C4286

'type1' : is caught by base class ('type2') on line number

The specified exception type is handled by a previous handler. The type for the second catch is derived from the type of the first. Exceptions for a base class catch exceptions for a derived class.

Example

//C4286.cpp
// compile with: /W1
#include <eh.h>
class C {};
class D : public  C {};
int main()
{
    try
    {
        throw "ooops!";
    }
    catch( C ) {}
    catch( D ) {}  // warning C4286, D is derived from C
}