mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 15:47:53 +02:00
* revert r39043 and r39045 which disallow static array constants inside dynamic constants for Delphi modes
git-svn-id: trunk@39078 -
This commit is contained in:
parent
4aa66d9033
commit
b7cc225149
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12504,7 +12504,6 @@ tests/test/tarray13.pp svneol=native#text/pascal
|
||||
tests/test/tarray14.pp svneol=native#text/pascal
|
||||
tests/test/tarray15.pp svneol=native#text/pascal
|
||||
tests/test/tarray16.pp svneol=native#text/pascal
|
||||
tests/test/tarray17.pp svneol=native#text/pascal
|
||||
tests/test/tarray2.pp svneol=native#text/plain
|
||||
tests/test/tarray3.pp svneol=native#text/plain
|
||||
tests/test/tarray4.pp svneol=native#text/plain
|
||||
|
@ -436,7 +436,7 @@ scan_n_changecputype=02105_N_Changed CPU type to be consistent with specified co
|
||||
#
|
||||
# Parser
|
||||
#
|
||||
# 03347 is the last used one
|
||||
# 03346 is the last used one
|
||||
#
|
||||
% \section{Parser messages}
|
||||
% This section lists all parser messages. The parser takes care of the
|
||||
@ -1575,11 +1575,6 @@ parser_e_cannot_use_hardfloat_in_a_softfloat_environment=03345_E_The HardFloat d
|
||||
parser_e_invalid_internal_function_index=03346_E_Index $1 is not a valid internal function index
|
||||
% The index specified for the \var{compilerproc} directive is not an index that's recognized
|
||||
% by the compiler.
|
||||
parser_e_no_static_array_const_in_dynarray_const=03347_E_Static array constants are not allowed inside dynamic array constants for Delphi modes
|
||||
% Delphi does not correctly parse static array constants inside dynamic array constants. As it
|
||||
% is also using different syntaxes for static array constants and dynamic array constants it isn't
|
||||
% clear either how the syntax would look like. Thus static array constants inside dynamic array
|
||||
% constants are prohibited for Delphi modes.
|
||||
%
|
||||
%
|
||||
% \end{description}
|
||||
|
@ -1197,16 +1197,6 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
|
||||
end
|
||||
else
|
||||
begin
|
||||
{ Delphi does not correctly parse static array constants
|
||||
inside dynamic array constants. Additionally static and
|
||||
dynamic array constants use different syntaxes ("(...)"
|
||||
vs. "[...]"), so it's safer we simply disallow it until
|
||||
the Delphi developers clears up this mess if ever }
|
||||
if (m_delphi in current_settings.modeswitches) and
|
||||
(def.elementdef.typ=arraydef) and
|
||||
not is_dynamic_array(def.elementdef) then
|
||||
Message(parser_e_no_static_array_const_in_dynarray_const);
|
||||
|
||||
if fsym.varspez=vs_const then
|
||||
sectype:=sec_rodata
|
||||
else
|
||||
|
@ -1,12 +0,0 @@
|
||||
{ %FAIL }
|
||||
|
||||
program tarray17;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
var
|
||||
v1: array of array[0..2] of LongInt = [(1, 2, 3), (4, 5, 6)];
|
||||
|
||||
begin
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user