21 lines
318 B
Plaintext
21 lines
318 B
Plaintext
=== Compliant solution
|
|
|
|
[source,text]
|
|
----
|
|
class BaseException { };
|
|
class DerivedException: public BaseException { };
|
|
|
|
try
|
|
{
|
|
// ...
|
|
}
|
|
catch ( DerivedException &d ) // Compliant
|
|
{
|
|
// ...
|
|
}
|
|
catch ( BaseException &b ) // Compliant, will be triggered for BaseException that are not DerivedException
|
|
{
|
|
// ...
|
|
}
|
|
----
|