From b7cc2251499eebf9a2640238139e43dbe2908791 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Mon, 21 May 2018 08:13:17 +0000 Subject: [PATCH] * revert r39043 and r39045 which disallow static array constants inside dynamic constants for Delphi modes git-svn-id: trunk@39078 - --- .gitattributes | 1 - compiler/msg/errore.msg | 7 +------ compiler/ngtcon.pas | 10 ---------- tests/test/tarray17.pp | 12 ------------ 4 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 tests/test/tarray17.pp diff --git a/.gitattributes b/.gitattributes index 67e1757d11..213480e85c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg index 09ec48c772..ef784d04ac 100644 --- a/compiler/msg/errore.msg +++ b/compiler/msg/errore.msg @@ -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} diff --git a/compiler/ngtcon.pas b/compiler/ngtcon.pas index 00fe419133..a4084bfa7c 100644 --- a/compiler/ngtcon.pas +++ b/compiler/ngtcon.pas @@ -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 diff --git a/tests/test/tarray17.pp b/tests/test/tarray17.pp deleted file mode 100644 index 1673051b04..0000000000 --- a/tests/test/tarray17.pp +++ /dev/null @@ -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.