Give a basic error message for use of _Generic.

This commit is contained in:
Stephen Heumann 2020-01-19 18:03:21 -06:00
parent dd92585116
commit 6e89dc5883
2 changed files with 7 additions and 1 deletions

View File

@ -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];

View File

@ -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^);