This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: Fix static data member error messages
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ PATCH: Fix static data member error messages
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 01 Jun 2000 00:41:59 -0700
- Organization: CodeSourcery, LLC
This fixes the tests that started failing earlier today.
Also, I marked g++.oliva/template7.C as XFAIL since it is, indeed,
expected to fail.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2000-06-01 Mark Mitchell <mark@codesourcery.com>
* init.c (resolve_offset_ref): Remove check for TREE_ADDRESSABLE
on FIELD_DECLs.
Index: testsuite/g++.old-deja/g++.oliva/template7.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.oliva/template7.C,v
retrieving revision 1.3
diff -c -p -r1.3 template7.C
*** template7.C 1999/11/19 06:36:45 1.3
--- template7.C 2000/06/01 07:30:30
***************
*** 1,9 ****
// Build don't link:
! // Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
// simplified from bug report by Paul Burchard <burchard@pobox.com>
template<class> struct A {};
template<template<class> class T> struct B {
--- 1,10 ----
// Build don't link:
! // Copyright (C) 1999, 2000 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
// simplified from bug report by Paul Burchard <burchard@pobox.com>
+ // crash test - XFAIL *-*-*
template<class> struct A {};
template<template<class> class T> struct B {
Index: cp/init.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/init.c,v
retrieving revision 1.195
diff -c -p -r1.195 init.c
*** init.c 2000/05/28 02:58:15 1.195
--- init.c 2000/06/01 07:30:46
*************** resolve_offset_ref (exp)
*** 1824,1836 ****
have been seen as static to be grok'd as non-static. */
if (TREE_CODE (member) == FIELD_DECL && current_class_ref == NULL_TREE)
{
! if (TREE_ADDRESSABLE (member) == 0)
! {
! cp_error_at ("member `%D' is non-static but referenced as a static member",
! member);
! error ("at this point in file");
! TREE_ADDRESSABLE (member) = 1;
! }
return error_mark_node;
}
--- 1824,1832 ----
have been seen as static to be grok'd as non-static. */
if (TREE_CODE (member) == FIELD_DECL && current_class_ref == NULL_TREE)
{
! cp_error_at ("member `%D' is non-static but referenced as a static member",
! member);
! error ("at this point in file");
return error_mark_node;
}