From 6e89dc58835e6c40a1056620670c90ef979924eb Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 19 Jan 2020 18:03:21 -0600 Subject: [PATCH] Give a basic error message for use of _Generic. --- Expression.pas | 7 ++++++- Scanner.pas | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Expression.pas b/Expression.pas index 1d0eee0..8d52ea5 100644 --- a/Expression.pas +++ b/Expression.pas @@ -1436,6 +1436,11 @@ if token.kind in startExpression then begin {handle a complex operand} DoOperand + else if token.kind = _Genericsy then begin + Error(144); + Skip; + goto 1; + end else begin {handle a constant operand} new(sp); @@ -3841,7 +3846,7 @@ procedure InitExpression; begin {InitExpression} startTerm := [ident,intconst,uintconst,longconst,ulongconst,doubleconst, - stringconst]; + stringconst,_Genericsy]; startExpression:= startTerm + [lparench,asteriskch,andch,plusch,minusch,excch,tildech,sizeofsy, plusplusop,minusminusop,typedef,_Alignofsy]; diff --git a/Scanner.pas b/Scanner.pas index 691b4b0..08fcc53 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -665,6 +665,7 @@ if list or (numErr <> 0) then begin 141: msg := @'_Noreturn specifier is only allowed on functions'; 142: msg := @'_Alignas may not be used in this declaration or type name'; 143: msg := @'only object pointer types may be restrict-qualified'; + 144: msg := @'generic selection expressions are not supported by ORCA/C'; otherwise: Error(57); end; {case} writeln(msg^);