Skip to content

Commit acaf6e3

Browse files
committed
boolean: don't allow NEG unary op '-' on boolean data types
- negative booleans were allowed for compatibility with fbc test suite (prior to Jan 2018) - can be removed now since test-suite has been re-written
1 parent e2ded82 commit acaf6e3

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Version 1.06.0
44
- Adjusted warning text for "mixed bool/nonbool operands" warning
55
- test-suite uses libfbcunit for unit testing framework
66
- SELECT CASE AS CONST respects data type and will show overflow warnings on out-of-range constants
7+
- boolean: don't allow NEG unary op '-' on boolean data types
78

89
[added]
910
- -noobjinfo option to disable the writing/reading of compile-time library and other linking options from/to .o and .a files. This also disables the use of fbextra.x (the supplemental linker script) for discarding the .fbctinf sections, which is useful when using the gold linker that doesn't support this kind of linker script.
@@ -58,6 +59,7 @@ Version 1.06.0
5859
- #878: Fix fbc-64bit hangs on 'Case True' + 'Case False' inside 'Select Case As const'
5960
- Fix SELECT CASE AS CONST to allow both signed & unsigned case range values
6061

62+
6163
Version 1.05.0
6264

6365
[changed]

src/compiler/ast-node-uop.bas

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ function astNewUOP _
182182
if( typeGetDtAndPtrOnly( o->dtype ) = FB_DATATYPE_BOOLEAN ) then
183183
if( op = AST_OP_NOT ) then
184184
do_promote = FALSE
185-
elseif( op = AST_OP_NEG ) then
186-
'' allow it or test suite can't compile
187185
else
188186
'' no other operation allowed with booleans
189187
exit function

tests/boolean/boolean_uop.bas

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ SUITE( fbc_tests.boolean_.boolean_uop )
3232
dot( not, FALSE )
3333
dot( not, TRUE )
3434

35-
dot( -, FALSE )
36-
dot( -, TRUE )
37-
3835
END_TEST
3936

4037
END_SUITE

0 commit comments

Comments
 (0)