public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14401] New: Uninitialized reference error not reported.
@ 2004-03-03 8:37 gwesp at flyelite dot ch
2004-03-03 15:41 ` [Bug c++/14401] [3.3/3.4/3.5 regression] " bangerth at dealii dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: gwesp at flyelite dot ch @ 2004-03-03 8:37 UTC (permalink / raw)
To: gcc-bugs
G++ erroneously compiles this code:
struct { struct { int& i ; } bar ; } foo ;
which should caues an error because the implicitly generated
constructor for foo.bar cannot initialize foo.bar.i .
--
Summary: Uninitialized reference error not reported.
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gwesp at flyelite dot ch
CC: gcc-bugs at gcc dot gnu dot org,gwesp at flyelite dot ch
GCC host triplet: Suse Linux 9.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14401] [3.3/3.4/3.5 regression] Uninitialized reference error not reported.
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
@ 2004-03-03 15:41 ` bangerth at dealii dot org
2004-03-03 18:40 ` giovannibajo at libero dot it
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-03-03 15:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-03-03 15:41 -------
Confirmed. Not even a warning is given with -W -Wall.
This is a regression in 3.3, 3.4 and mainline, because up to 3.2
we get this:
g/x> /home/bangerth/bin/gcc-3.2*/bin/c++ -c x.cc -W -Wall -Wunused
x.cc:1: warning: non-static reference `int&<anonymous struct>::<anonymous
struct>::i' in class without a constructor
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |3.3.4 3.4.0 3.5.0
Known to work| |2.95.3 3.2.3
Last reconfirmed|0000-00-00 00:00:00 |2004-03-03 15:41:01
date| |
Summary|Uninitialized reference |[3.3/3.4/3.5 regression]
|error not reported. |Uninitialized reference
| |error not reported.
Target Milestone|--- |3.3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14401] [3.3/3.4/3.5 regression] Uninitialized reference error not reported.
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
2004-03-03 15:41 ` [Bug c++/14401] [3.3/3.4/3.5 regression] " bangerth at dealii dot org
@ 2004-03-03 18:40 ` giovannibajo at libero dot it
2004-03-09 7:27 ` cvs-commit at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-03 18:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-03-03 18:40 -------
The code is actually ill-formed.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14401] [3.3/3.4/3.5 regression] Uninitialized reference error not reported.
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
2004-03-03 15:41 ` [Bug c++/14401] [3.3/3.4/3.5 regression] " bangerth at dealii dot org
2004-03-03 18:40 ` giovannibajo at libero dot it
@ 2004-03-09 7:27 ` cvs-commit at gcc dot gnu dot org
2004-03-09 8:17 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-09 7:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-09 07:27 -------
Subject: Bug 14401
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: mmitchel@gcc.gnu.org 2004-03-09 07:27:26
Modified files:
gcc/cp : ChangeLog class.c init.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/ext: anon-struct4.C
gcc/testsuite/g++.dg/init: ctor3.C union1.C
Log message:
PR c++/14401
* class.c (check_field_decls): Complain about non-static data
members of reference type in unions. Propagate
CLASSTYPE_REF_FIELDS_NEED_INIT and
CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
data members.
* init.c (perform_member_init): Complain about mbmers with const
type that are not explicitly initialized.
PR c++/14401
* g++.dg/init/ctor3.C: New test.
* g++.dg/init/union1.C: New test.
* g++.dg/ext/anon-struct4.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.72&r2=1.3892.2.73
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.595.4.6&r2=1.595.4.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.356.2.6&r2=1.356.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.131&r2=1.3389.2.132
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/anon-struct4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/ctor3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/union1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14401] [3.3/3.4/3.5 regression] Uninitialized reference error not reported.
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
` (2 preceding siblings ...)
2004-03-09 7:27 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-09 8:17 ` cvs-commit at gcc dot gnu dot org
2004-03-09 8:20 ` [Bug c++/14401] [3.3 " mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-09 8:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-09 08:16 -------
Subject: Bug 14401
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2004-03-09 08:16:49
Modified files:
gcc/cp : ChangeLog class.c cp-tree.h decl.c init.c lex.c
name-lookup.c name-lookup.h ptree.c search.c
typeck.c
gcc/testsuite : ChangeLog
gcc/testsuite/g++.dg/lookup: koenig1.C used-before-declaration.C
gcc/testsuite/g++.dg/other: do1.C
gcc/testsuite/g++.dg/overload: koenig1.C
gcc/testsuite/g++.dg/parse: crash13.C
gcc/testsuite/g++.dg/template: instantiate3.C
Added files:
gcc/testsuite/g++.dg/ext: anon-struct4.C
gcc/testsuite/g++.dg/init: ctor3.C union1.C
Log message:
PR c++/14401
* class.c (check_field_decls): Complain about non-static data
members of reference type in unions. Propagate
CLASSTYPE_REF_FIELDS_NEED_INIT and
CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
data members.
* init.c (perform_member_init): Complain about mbmers with const
type that are not explicitly initialized.
PR c++/14401
* g++.dg/init/ctor3.C: New test.
* g++.dg/init/union1.C: New test.
* g++.dg/ext/anon-struct4.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3987&r2=1.3988
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.602&r2=1.603
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.955&r2=1.956
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1192&r2=1.1193
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.363&r2=1.364
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/lex.c.diff?cvsroot=gcc&r1=1.325&r2=1.326
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.43&r2=1.44
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.h.diff?cvsroot=gcc&r1=1.18&r2=1.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ptree.c.diff?cvsroot=gcc&r1=1.38&r2=1.39
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&r1=1.287&r2=1.288
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.530&r2=1.531
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3583&r2=1.3584
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/anon-struct4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/ctor3.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/union1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/koenig1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/used-before-declaration.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/do1.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/overload/koenig1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash13.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/instantiate3.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14401] [3.3 regression] Uninitialized reference error not reported.
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
` (3 preceding siblings ...)
2004-03-09 8:17 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-09 8:20 ` mmitchel at gcc dot gnu dot org
2004-03-13 2:31 ` cvs-commit at gcc dot gnu dot org
2004-03-13 2:33 ` gdr at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-03-09 8:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-03-09 08:20 -------
Fixed in GCC 3.4 and GCC 3.5.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|3.3.4 3.4.0 3.5.0 |3.3.4
Summary|[3.3/3.4/3.5 regression] |[3.3 regression]
|Uninitialized reference |Uninitialized reference
|error not reported. |error not reported.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14401] [3.3 regression] Uninitialized reference error not reported.
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
` (4 preceding siblings ...)
2004-03-09 8:20 ` [Bug c++/14401] [3.3 " mmitchel at gcc dot gnu dot org
@ 2004-03-13 2:31 ` cvs-commit at gcc dot gnu dot org
2004-03-13 2:33 ` gdr at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-13 2:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-13 02:31 -------
Subject: Bug 14401
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_3-branch
Changes by: gdr@gcc.gnu.org 2004-03-13 02:31:37
Modified files:
gcc/cp : ChangeLog class.c init.c
Added files:
gcc/testsuite/g++.dg/ext: anon-struct4.C
gcc/testsuite/g++.dg/init: ctor3.C union1.C
Log message:
Backport:
2004-03-08 Mark Mitchell <mark@codesourcery.com>
PR c++/14401
* class.c (check_field_decls): Complain about non-static data
members of reference type in unions. Propagate
CLASSTYPE_REF_FIELDS_NEED_INIT and
CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of
non-static
data members.
* init.c (perform_member_init): Complain about members with const
type that are not explicitly initialized.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.261&r2=1.3076.2.262
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.499.2.27&r2=1.499.2.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.299.2.15&r2=1.299.2.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/anon-struct4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.2.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/ctor3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.2.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/union1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.2.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14401] [3.3 regression] Uninitialized reference error not reported.
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
` (5 preceding siblings ...)
2004-03-13 2:31 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-13 2:33 ` gdr at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-03-13 2:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at gcc dot gnu dot org 2004-03-13 02:33 -------
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01091.html
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14401
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-03-13 2:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03 8:37 [Bug c++/14401] New: Uninitialized reference error not reported gwesp at flyelite dot ch
2004-03-03 15:41 ` [Bug c++/14401] [3.3/3.4/3.5 regression] " bangerth at dealii dot org
2004-03-03 18:40 ` giovannibajo at libero dot it
2004-03-09 7:27 ` cvs-commit at gcc dot gnu dot org
2004-03-09 8:17 ` cvs-commit at gcc dot gnu dot org
2004-03-09 8:20 ` [Bug c++/14401] [3.3 " mmitchel at gcc dot gnu dot org
2004-03-13 2:31 ` cvs-commit at gcc dot gnu dot org
2004-03-13 2:33 ` gdr at gcc dot gnu 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).