Closed Ofenhed closed 3 years ago
@junjihashimoto , could you take a look at this?
Digging around in the code shows that a template can only have TypeSpecifier
s and numbers as argument. From what I can gather from the code, it seems that pointers (even more so if they are volatile), arrays, consts, long longs and chars with specified sign are examples of types which cannot be used. I was going to take a stab at it, but this looks as if it might need a bigger patch than I'd be comfortable submitting.
@bitonic @Ofenhed I'm sorry I didn't notice immediately. https://github.com/fpco/inline-c/blob/master/inline-c/src/Language/C/Types/Parse.hs#L641-L783 It seems that pointers cannot be used grammatically. This was not intended. C++ often uses smart pointers instead of raw pointers, so I'm not in trouble at all.
https://github.com/fpco/inline-c/pull/114
This PR does not support arrays, consts and so on, but std::vector<int*>
is supported.
@junjihashimoto thanks.
@Ofenhed can you try current master and see if things work for you?
Thank you. Yes, it works for my use case. For now I guess the unsupported types can be reached using a typedef.
It seems that any pointer in a template definition breaks compilation.
For reference, here's a test that breaks compilation: