Using SWIG 2.0.2
When using the result of a comparison to define an enum value, in this case in a C++ template class, I get the following error "Error: Syntax error in input(3)."
I can work around it by copying the header and just leaving the enum values out, but SWIG should work with this. For reference, using '==', '!=", '>=', or '<=' all work, it's just '<' and '>' that produce the error.
This is a simple example that produces the error:
template<typename Tp>
struct SizeInfo {
enum {
isLarge = (sizeof(Tp)>sizeof(void*)),
isPointer = false
};
};
SWIG erros on the line "isLarge = (sizeof(Tp)>sizeof(void*)),", hover changing the line to "isLarge = (sizeof(Tp)>=sizeof(void*)+1)", or any operator other than '<' or '>' parses fine.
This is a current limitation in the parser. There's a comment about it in Source/CParse/parser.y:
Last edit: Olly Betts 2013-01-08
This is also in the github tracker:
https://github.com/swig/swig/issues/80
Closing this one as a duplicate.