This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33975] New: [4.1/4.2/4.3 Regression] Incomplete types may be derefenced
- From: "andrew dot stubbs at st dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2007 17:58:15 -0000
- Subject: [Bug c++/33975] New: [4.1/4.2/4.3 Regression] Incomplete types may be derefenced
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following C++ program should not compile:
struct S;
int f(S s);
S *p;
int i = f(*p);
Here an incomplete type is dereferenced as it is passed as a function
argument.
This is forbidden by the C++ standard, clause 3, paragraph 4 (penultimate
bullet). And anyway, how could you compile it to anything sensible without
knowing how big the type is?
Other attempts to dereference incomplete types are diagnosed correctly.
This used to be diagnosed in GCC 4.1.1, but is missing in GCC 4.1.2 onwards.
--
Summary: [4.1/4.2/4.3 Regression] Incomplete types may be
derefenced
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andrew dot stubbs at st dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33975