Browse Source

* enable OpenStrings by default in mode Delphi
+ added test

Sven/Sarah Barth 2 years ago
parent
commit
188cac3bc6
2 changed files with 24 additions and 2 deletions
  1. 6 2
      compiler/scanner.pas
  2. 18 0
      tests/tbs/tb0698.pp

+ 6 - 2
compiler/scanner.pas

@@ -624,12 +624,16 @@ implementation
                  include(init_settings.localswitches,cs_strict_var_strings);
                  include(init_settings.localswitches,cs_strict_var_strings);
              end;
              end;
 
 
-           { in delphi mode, excess precision is by default on }
+           { in delphi mode, excess precision and open strings are by default on }
            if ([m_delphi] * current_settings.modeswitches <> []) then
            if ([m_delphi] * current_settings.modeswitches <> []) then
              begin
              begin
                include(current_settings.localswitches,cs_excessprecision);
                include(current_settings.localswitches,cs_excessprecision);
+               include(current_settings.localswitches,cs_openstring);
                if changeinit then
                if changeinit then
-                 include(init_settings.localswitches,cs_excessprecision);
+                 begin
+                   include(init_settings.localswitches,cs_excessprecision);
+                   include(init_settings.localswitches,cs_openstring);
+                 end;
              end;
              end;
 
 
 {$ifdef i8086}
 {$ifdef i8086}

+ 18 - 0
tests/tbs/tb0698.pp

@@ -0,0 +1,18 @@
+{ %NORUN }
+
+program tb0698;
+
+{ Open Strings is by default enabled in mode Delphi }
+
+{$mode delphi}
+
+procedure Test(var aArg: ShortString);
+begin
+end;
+
+var
+  s: String[5];
+begin
+  s := 'Test';
+  Test(s);
+end.