re PR c++/14401 (Uninitialized reference error not reported.)
authorMark Mitchell <mark@codesourcery.com>
Tue, 9 Mar 2004 08:16:49 +0000 (08:16 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 9 Mar 2004 08:16:49 +0000 (08:16 +0000)
commit58ec3cc5c0c441e0e8c49c029be9e25dcb1d853d
tree4053bda91421405c7881ecbb817f38fb71ebe500
parentf1c4ca32d04cf16aa78c857acca00f7eebb9b9da
re PR c++/14401 (Uninitialized reference error not reported.)

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.

From-SVN: r79158
21 files changed:
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/init.c
gcc/cp/lex.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/cp/ptree.c
gcc/cp/search.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/anon-struct4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/init/ctor3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/init/union1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/lookup/koenig1.C
gcc/testsuite/g++.dg/lookup/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