mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
CPP: Improve the UnknwonType example as suggested.
This commit is contained in:
@@ -329,12 +329,13 @@ class ErroneousType extends BuiltInType {
|
||||
* The unknown type. This type has no corresponding C/C++ syntax.
|
||||
*
|
||||
* Unknown types usually occur inside _uninstantiated_ template functions.
|
||||
* In the example below, the type of the ternary `?:` expression cannot
|
||||
* be determined:
|
||||
* In the example below, the expressions `x.a` and `x.b` have unknown type
|
||||
* in the _uninstantiated_ template.
|
||||
* ```
|
||||
* template <typename T>
|
||||
* T min(T x, T y) {
|
||||
* return (x < y) ? x : y;
|
||||
* template<typename T>
|
||||
* bool check(T x) {
|
||||
* if (x.a == x.b)
|
||||
* abort();
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user