From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.41.100 with SMTP id g64mr3122579yhb.31.1382112106378; Fri, 18 Oct 2013 09:01:46 -0700 (PDT) X-Received: by 10.182.33.4 with SMTP id n4mr34819obi.9.1382112106238; Fri, 18 Oct 2013 09:01:46 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!us.feeder.erje.net!news.glorb.com!i2no19271492qav.0!news-out.google.com!9ni52399qaf.0!nntp.google.com!i2no19271485qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 18 Oct 2013 09:01:46 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.123.228.141; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 97.123.228.141 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9bc1be39-4377-4df5-8686-786babc756d1@googlegroups.com> Subject: Possible GNAT problem with aliased parameters. From: Shark8 Injection-Date: Fri, 18 Oct 2013 16:01:46 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 2540 Xref: number.nntp.dca.giganews.com comp.lang.ada:183658 Date: 2013-10-18T09:01:46-07:00 List-Id: The Ada 2012 Rational says the following about Aliased parameters: > The other change in Ada 2012 concerning parameters is that they may be > explicitly marked aliased thus procedure P(X: aliased in out T; ... ); > As a consequence within P we can write X'Access. Yet, when such parameters are thus used (X'Access) the compiler generates the following message "access-to-variable designates constant" and fails the compilation. -- Example: ----------- Package Test is Type Maze(<>) is tagged private; None : Aliased Constant Maze; Function Create( North, South, East, West : Aliased Maze'Class:= None ) return Maze; Private Type Paths is Array(Positive range <>) of Access Maze'Class; Type Maze( Length : Natural ) is tagged record Exits : Paths(1..Length); end record; -- Note: Expression-function used so everything is defined in-spec. Function Create( North, South, East, West : Aliased Maze'Class:= None ) return Maze is ( Maze'(Length => 4, Exits => (North'Access, South'Access, East'Access, West'Access)) ); None : Aliased Constant Maze := ( Length => 0, Others => <> ); End Test;