diff --git a/Expression.pas b/Expression.pas index 85bf542..98c76f1 100644 --- a/Expression.pas +++ b/Expression.pas @@ -1892,6 +1892,13 @@ var controllingType.kind := pointerType; controllingType.pType := expressionType; end {if} + else if expressionType^.kind in [structType,unionType] then begin + controllingType.size := expressionType^.size; + controllingType.saveDisp := 0; + controllingType.isConstant := false; + controllingType.kind := definedType; + controllingType.dType := expressionType; + end {else if} else controllingType := expressionType^; if controllingType.kind = arrayType then @@ -1910,7 +1917,7 @@ var TypeName; {get the type name} currentType := typeSpec; if (currentType^.size = 0) or (currentType^.kind = functionType) then - Error(161); + Error(133); tl := typesSeen; {check if it is a duplicate} while tl <> nil do begin if CompTypes(currentType, tl^.theType) then begin diff --git a/Scanner.pas b/Scanner.pas index 434cd5d..aed7d15 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -699,7 +699,6 @@ if list or (numErr <> 0) then begin 158: msg := @'_Generic expression includes two compatible types'; 159: msg := @'_Generic expression includes multiple default cases'; 160: msg := @'no matching association in _Generic expression'; - 161: msg := @'complete object type expected'; otherwise: Error(57); end; {case} writeln(msg^);