>
>
>
V741. Use of the throw (a, b); pattern.…


V741. Use of the throw (a, b); pattern. It is possible that type name was omitted: throw MyException(a, b);.

The analyzer detected the throw keyword followed by a pair of parentheses with various values inside separated by commas. It is very likely that the programmer forgot to specify the type of the exception to be thrown.

Consider the following example:

throw ("foo", 123);

Although the code looks strange, it compiles successfully. In this case, executing the comma operator ',' results in the value 123. Therefore, an exception of type 'int' will be thrown.

In other words, the code above is equivalent to the following:

throw 123;

Correct code:

throw MyException("foo", 123);

This diagnostic is classified as: