public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/42411] New: Illegal program accepted, RM 4.1(8), 8.6(27)/2
@ 2009-12-17 19:47 ludovic at ludovic-brenta dot org
2009-12-17 19:48 ` [Bug ada/42411] " ludovic at ludovic-brenta dot org
0 siblings, 1 reply; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2009-12-17 19:47 UTC (permalink / raw)
To: gcc-bugs
package pak1 is
type T1 is new integer;
type T1_access is access all T1;
x1: aliased T1;
x2: T1 := x1'access.all; --ERROR: 4.1(8) (missed)
x3: T1_access := T1_access(x1'access); --ERROR: 4.6(6) (detected)
end pak1;
Gnat misses the error involving x1'access.all.
RM 3.10.2(2)/2 says "the expected type (for 'access) shall be
a single access type". But ".all" doesn't provide a single
access type. Instead, by RM 4.1(8), the name in a dereference
"is expected to be of any access type".
The rule for type_conversions (x3) is similar. RM 4.6(6) says
"The operand of a type_conversion is expected to be of any type."
Gnat does detect this error.
$ gnatmake pak1
gcc-4.3 -c pak1.ads
pak1.ads:6:21: argument of conversion cannot be access
pak1.ads:6:21: use qualified expression instead
gnatmake: "pak1.ads" compilation error
--
Summary: Illegal program accepted, RM 4.1(8), 8.6(27)/2
Product: gcc
Version: 4.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ludovic at ludovic-brenta dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42411
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug ada/42411] Illegal program accepted, RM 4.1(8), 8.6(27)/2
2009-12-17 19:47 [Bug ada/42411] New: Illegal program accepted, RM 4.1(8), 8.6(27)/2 ludovic at ludovic-brenta dot org
@ 2009-12-17 19:48 ` ludovic at ludovic-brenta dot org
0 siblings, 0 replies; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2009-12-17 19:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ludovic at ludovic-brenta dot org 2009-12-17 19:47 -------
RM 8.6(27)/2 is also relevant:
When a construct is one that requires that its expected type be a
single type in a given class, the type of the construct shall be
determinable solely from the context in which the construct appears,
excluding the construct itself, but using the requirement that it be in
the given class. Furthermore, the context shall not be one that expects
any type in some class that contains types of the given class; in
particular, the construct shall not be the operand of a
type_conversion.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42411
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-17 19:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17 19:47 [Bug ada/42411] New: Illegal program accepted, RM 4.1(8), 8.6(27)/2 ludovic at ludovic-brenta dot org
2009-12-17 19:48 ` [Bug ada/42411] " ludovic at ludovic-brenta dot org
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).