Fix spaceship preproc tests for previous change

This commit is contained in:
Olly Betts 2022-07-27 18:17:31 +12:00
commit 346ede21c3
4 changed files with 13 additions and 3 deletions

View file

@ -0,0 +1,6 @@
%module xxx
/* Note: needs -Wextra to see these warnings */
/* Spaceship operator doesn't seem to be allowed in preprocessor expressions. */
#if (4 <=> 2) < 0
#endif

View file

@ -0,0 +1,2 @@
cpp_pp_expressions_bad.i:5: Warning 202: Could not evaluate expression '(4 <=> 2) < 0'
cpp_pp_expressions_bad.i:5: Warning 202: Spaceship operator (<=>) not allowed in preprocessor expression

View file

@ -67,6 +67,8 @@
#if "1" == +"1"
#endif
/* Spaceship operator doesn't seem to be allowed in preprocessor expressions. */
/* Spaceship operator doesn't seem to be allowed in preprocessor expressions,
* and isn't valid in C at all.
*/
#if (4 <=> 2) < 0
#endif

View file

@ -31,5 +31,5 @@ pp_expressions_bad.i:64: Warning 202: Could not evaluate expression '"1" == ~"1"
pp_expressions_bad.i:64: Warning 202: Syntax error: attempt to apply unary operator to string
pp_expressions_bad.i:67: Warning 202: Could not evaluate expression '"1" == +"1"'
pp_expressions_bad.i:67: Warning 202: Syntax error: attempt to apply unary operator to string
pp_expressions_bad.i:71: Warning 202: Could not evaluate expression '(4 <=> 2) < 0'
pp_expressions_bad.i:71: Warning 202: Spaceship operator (<=>) not allowed in preprocessor expression
pp_expressions_bad.i:73: Warning 202: Could not evaluate expression '(4 <=> 2) < 0'
pp_expressions_bad.i:73: Warning 202: Syntax error