Consider the following parameter declaration:
WrapVTK misinterprets x as a type, rather than as the parameter name, which the parser assumes is missing. Because of where it assumes the parameter name should be, it actually assumes the parameter is a function:
Whereas the correct parse would give the following:
This is illustrative of a bug with our parser. When it encounters a parse where an identifier could be interpreted as either a parameter name or as a type, it sometimes misinterprets a parameter name as a type. For example, WrapVTK's parse would be correct if we replaced x with int, or if x is a typedef of int.
Here, int cannot be interpreted as a parameter name, therefore we (and any parser) must assume that the parameter name is missing from the declaration i.e. void func(int* f(int[3])).
A real C++ parser will know, from previous definitions, whether x is a type. But our parser doesn't utilize previous definitions to adjust its parse.
In any case, this is an edge case of the C++ grammar, and it doesn't come up often in real code.
So back to your regular scheduled programming...
Consider the following parameter declaration:
WrapVTK misinterprets
xas a type, rather than as the parameter name, which the parser assumes is missing. Because of where it assumes the parameter name should be, it actually assumes the parameter is a function:Whereas the correct parse would give the following:
This is illustrative of a bug with our parser. When it encounters a parse where an identifier could be interpreted as either a parameter name or as a type, it sometimes misinterprets a parameter name as a type. For example, WrapVTK's parse would be correct if we replaced
xwithint, or ifxis a typedef ofint.Here,
intcannot be interpreted as a parameter name, therefore we (and any parser) must assume that the parameter name is missing from the declaration i.e.void func(int* f(int[3])).A real C++ parser will know, from previous definitions, whether
xis a type. But our parser doesn't utilize previous definitions to adjust its parse.In any case, this is an edge case of the C++ grammar, and it doesn't come up often in real code.
So back to your regular scheduled programming...