public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bauhaus at futureapps dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/30614] New: compiler puts the blame on in parameter mode, not pointer to constant, for assignment to component Date: Sat, 27 Jan 2007 17:11:00 -0000 [thread overview] Message-ID: <bug-30614-5804@http.gcc.gnu.org/bugzilla/> (raw) gcc reports two different error messages, the second of them doesn't seem to be correct. If it is somehow correct (I don't think so), it is still misleading: $ gnatmake -gnatv p.adb gcc -c -gnatv p.adb GNAT 4.3.0 20070127 (experimental) Copyright 1992-2006, Free Software Foundation, Inc. Compiling: p.adb (source file time stamp: 2007-01-27 13:38:37) 5. this.x := value; | >>> left hand side of assignment must be a variable 10. this.x := 42; | >>> assignment to "in" mode parameter not allowed 13 lines: 2 errors gnatmake: "p.adb" compilation error The first message is correct because "this" is a pointer to constant. The second message should be the same because the parameter mode should only affects the mode of the pointer parameter ("this") not the pointee. (When T_Ptr is made access-to-variable, both lines compile fine.) package P is type T is tagged limited private; type T_Ptr is access constant T; -- Note: constant procedure reset(this: T_Ptr); procedure set(this: T_Ptr; value: Integer); private type T is tagged limited record x: Integer; end record; end P; package body P is procedure set(this: T_Ptr; value: Integer) is begin this.x := value; end set; procedure reset(this: T_Ptr) is begin this.x := 42; end reset; end P; -- Summary: compiler puts the blame on in parameter mode, not pointer to constant, for assignment to component Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bauhaus at futureapps dot de GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30614
next reply other threads:[~2007-01-27 17:11 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-01-27 17:11 bauhaus at futureapps dot de [this message] 2008-04-12 20:06 ` [Bug ada/30614] " sam at gcc dot gnu dot org 2008-11-17 21:17 ` sam at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-30614-5804@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).