Only recognise spaceship operator for C++
I don't think any valid C program can contain `<=>` in a tokenisable context, but it's more helpful to fail with a syntax error at SWIG parse time and not potentially generate C code trying to use `<=>` in an expression which then fails at compile time.
This commit is contained in:
parent
54ddefe410
commit
100d4d5350
3 changed files with 5 additions and 1 deletions
3
Examples/test-suite/errors/c_spaceship.i
Normal file
3
Examples/test-suite/errors/c_spaceship.i
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
%module xxx
|
||||
|
||||
int a[(1<=>2>1)];
|
||||
1
Examples/test-suite/errors/c_spaceship.stderr
Normal file
1
Examples/test-suite/errors/c_spaceship.stderr
Normal file
|
|
@ -0,0 +1 @@
|
|||
c_spaceship.i:3: Error: Syntax error in input(1).
|
||||
Loading…
Add table
Add a link
Reference in a new issue