This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH]: struct location diags
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH]: struct location diags
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Fri, 05 Jan 2001 11:40:09 +0000
- Organization: Codesourcery LLC
Hi,
this patch tweaks the diagnostic location given for structure definitions.
The current behaviour uses the closing } when telling you about things
like there's no ctor and the bases have no default ctor etc. This patch
fixes things to use the open { of the struct, as is done when refering
to the struct from elsewhere
built & tested on i686-pc-linux-gnu, ok?
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-01-05 Nathan Sidwell <nathan@codesourcery.com>
* class.c (duplicate_tag_error): Adjust diagnostic.
(finish_struct): Locally set location to start of struct.
* decl.c (fixup_anonymous_aggr): Use cp_error_at.
2001-01-05 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.benjamin/15309-1.C: Expect diagnostic at
start of structs.
* g++.old-deja/g++.benjamin/15309-2.C: Likewise.
* g++.old-deja/g++.brendan/crash17.C: Likewise.
* g++.old-deja/g++.brendan/crash29.C: Likewise.
* g++.old-deja/g++.brendan/crash48.C: Likewise.
* g++.old-deja/g++.brendan/ns1.C: Likewise.
* g++.old-deja/g++.brendan/warnings1.C: Likewise.
* g++.old-deja/g++.bugs/900205_04.C: Likewise.
* g++.old-deja/g++.bugs/900514_03.C: Likewise.
* g++.old-deja/g++.eh/spec6.C: Likewise.
* g++.old-deja/g++.jason/crash3.C: Likewise.
* g++.old-deja/g++.law/ctors11.C: Likewise.
* g++.old-deja/g++.law/ctors17.C: Likewise.
* g++.old-deja/g++.law/ctors5.C: Likewise.
* g++.old-deja/g++.law/ctors9.C: Likewise.
* g++.old-deja/g++.mike/ambig1.C: Likewise.
* g++.old-deja/g++.mike/net22.C: Likewise.
* g++.old-deja/g++.mike/p3538a.C: Likewise.
* g++.old-deja/g++.mike/p3538b.C: Likewise.
* g++.old-deja/g++.mike/virt3.C: Likewise.
* g++.old-deja/g++.niklas/t128.C: Likewise.
* g++.old-deja/g++.other/anon4.C: Likewise.
* g++.old-deja/g++.other/using1.C: Likewise.
* g++.old-deja/g++.other/warn3.C: Likewise.
* g++.old-deja/g++.pt/t37.C: Likewise.
* g++.old-deja/g++.robertl/eb69.C: Likewise.
* g++.old-deja/g++.robertl/eb71.C: Likewise.
Index: cp/class.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/class.c,v
retrieving revision 1.350
diff -c -3 -p -r1.350 class.c
*** class.c 2001/01/03 00:24:02 1.350
--- class.c 2001/01/05 09:55:34
*************** duplicate_tag_error (t)
*** 2316,2322 ****
tree t;
{
cp_error ("redefinition of `%#T'", t);
! cp_error_at ("previous definition here", t);
/* Pretend we haven't defined this type. */
--- 2316,2322 ----
tree t;
{
cp_error ("redefinition of `%#T'", t);
! cp_error_at ("previous definition of `%#T'", t);
/* Pretend we haven't defined this type. */
*************** tree
*** 5328,5339 ****
--- 5328,5347 ----
finish_struct (t, attributes)
tree t, attributes;
{
+ char *saved_filename = input_filename;
+ int saved_lineno = lineno;
+
/* Now that we've got all the field declarations, reverse everything
as necessary. */
unreverse_member_declarations (t);
cplus_decl_attributes (t, attributes, NULL_TREE);
+ /* Nadger the current location so that diagnostics point to the start of
+ the struct, not the end. */
+ input_filename = DECL_SOURCE_FILE (TYPE_NAME (t));
+ lineno = DECL_SOURCE_LINE (TYPE_NAME (t));
+
if (processing_template_decl)
{
finish_struct_methods (t);
*************** finish_struct (t, attributes)
*** 5341,5346 ****
--- 5349,5357 ----
}
else
finish_struct_1 (t);
+
+ input_filename = saved_filename;
+ lineno = saved_lineno;
TYPE_BEING_DEFINED (t) = 0;
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.730
diff -c -3 -p -r1.730 decl.c
*** decl.c 2001/01/03 00:24:03 1.730
--- decl.c 2001/01/05 09:55:37
*************** fixup_anonymous_aggr (t)
*** 6978,6984 ****
/* ISO C++ 9.5.3. Anonymous unions may not have function members. */
if (TYPE_METHODS (t))
! error ("an anonymous union cannot have function members");
}
/* Make sure that a declaration with no declarator is well-formed, i.e.
--- 6978,6984 ----
/* ISO C++ 9.5.3. Anonymous unions may not have function members. */
if (TYPE_METHODS (t))
! cp_error_at ("an anonymous union cannot have function members", t);
}
/* Make sure that a declaration with no declarator is well-formed, i.e.
Index: testsuite/g++.old-deja/g++.benjamin/15309-1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.benjamin/15309-1.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 15309-1.C
*** 15309-1.C 1998/12/16 21:21:47 1.2
--- 15309-1.C 2001/01/05 09:55:37
*************** public:
*** 10,20 ****
};
class miami : public bahamian
! {
public:
miami ();
~miami ();
! }; // WARNING - // WARNING -
--- 10,20 ----
};
class miami : public bahamian
! { // WARNING - // WARNING -
public:
miami ();
~miami ();
! };
Index: testsuite/g++.old-deja/g++.benjamin/15309-2.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.benjamin/15309-2.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 15309-2.C
*** 15309-2.C 1998/12/16 21:21:48 1.2
--- 15309-2.C 2001/01/05 09:55:37
***************
*** 3,10 ****
// Build don't link:
// Special g++ Options: -Wnon-virtual-dtor -Weffc++
! class bermuda {
public:
virtual int func1(int);
~bermuda();
! }; // WARNING - // WARNING -
--- 3,10 ----
// Build don't link:
// Special g++ Options: -Wnon-virtual-dtor -Weffc++
! class bermuda { // WARNING - // WARNING -
public:
virtual int func1(int);
~bermuda();
! };
Index: testsuite/g++.old-deja/g++.brendan/crash17.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.brendan/crash17.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 crash17.C
*** crash17.C 1998/12/16 21:23:27 1.2
--- crash17.C 2001/01/05 09:55:37
*************** class GnWidget : public GnObject {
*** 30,35 ****
virtual ~GnWidget();
};
! class GnOptionGroup : public GnObject, public GnWidget {
! };// ERROR - warning
--- 30,35 ----
virtual ~GnWidget();
};
! class GnOptionGroup : public GnObject, public GnWidget {// ERROR - warning
! };
Index: testsuite/g++.old-deja/g++.brendan/crash29.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.brendan/crash29.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 crash29.C
*** crash29.C 1998/12/16 21:23:40 1.3
--- crash29.C 2001/01/05 09:55:37
*************** union Value
*** 7,15 ****
};
struct GlobalAddress
! {
GlobalAddress(Value *nvar){}// ERROR - .*
! };// ERROR - candidates .*
int
main()
--- 7,15 ----
};
struct GlobalAddress
! {// ERROR - candidates .*
GlobalAddress(Value *nvar){}// ERROR - .*
! };
int
main()
Index: testsuite/g++.old-deja/g++.brendan/crash48.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.brendan/crash48.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 crash48.C
*** crash48.C 1998/12/16 21:24:02 1.3
--- crash48.C 2001/01/05 09:55:37
***************
*** 1,14 ****
// Build don't link:
// GROUPS passed old-abort
! class internal {
int field;
int anotherfield;
! }; // ERROR - candidates are
! class bug {
internal* numbers;
bug(int size);
! }; // ERROR - several errors
bug::bug(int size)
{ // ERROR - candidates
--- 1,14 ----
// Build don't link:
// GROUPS passed old-abort
! class internal { // ERROR - candidates are
int field;
int anotherfield;
! };
! class bug { // ERROR - several errors
internal* numbers;
bug(int size);
! };
bug::bug(int size)
{ // ERROR - candidates
Index: testsuite/g++.old-deja/g++.brendan/ns1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.brendan/ns1.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ns1.C
*** ns1.C 1998/12/16 21:26:18 1.3
--- ns1.C 2001/01/05 09:55:37
*************** struct B
*** 7,18 ****
};
class C
! {
int g();
! };// ERROR - warning
class D2 : public B
! {
using B::f; // ok: B is a base of D
using C::g; // error: C isn't a base of D2
! }; // ERROR - type C is not a base type for type D2
--- 7,18 ----
};
class C
! { // ERROR - warning
int g();
! };
class D2 : public B
! { // ERROR - type C is not a base type for type D2
using B::f; // ok: B is a base of D
using C::g; // error: C isn't a base of D2
! };
Index: testsuite/g++.old-deja/g++.brendan/warnings1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.brendan/warnings1.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 warnings1.C
*** warnings1.C 1998/12/16 21:28:05 1.2
--- warnings1.C 2001/01/05 09:55:37
***************
*** 1,6 ****
// Build don't link:
// GROUPS passed warnings
// there should be a warning about foo only defining private methods
! class foo {
int bar();
! };// ERROR - .*
--- 1,6 ----
// Build don't link:
// GROUPS passed warnings
// there should be a warning about foo only defining private methods
! class foo { // ERROR - .*
int bar();
! };
Index: testsuite/g++.old-deja/g++.bugs/900205_04.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 900205_04.C
*** 900205_04.C 1998/12/16 21:28:27 1.2
--- 900205_04.C 2001/01/05 09:55:37
*************** struct0::struct0 (int, void *)
*** 18,25 ****
{
}
! struct struct0_derived_struct_0 : public struct0 {
! }; // ERROR -
// struct0_derived_struct_0 object; // would give g++ error if compiled
--- 18,25 ----
{
}
! struct struct0_derived_struct_0 : public struct0 { // ERROR -
! };
// struct0_derived_struct_0 object; // would give g++ error if compiled
Index: testsuite/g++.old-deja/g++.bugs/900514_03.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C,v
retrieving revision 1.4
diff -c -3 -p -r1.4 900514_03.C
*** 900514_03.C 1998/12/16 21:29:40 1.4
--- 900514_03.C 2001/01/05 09:55:38
***************
*** 13,24 ****
struct t_0_st_0;
! struct t_0_st_1 {
int member;
t_0_st_1 (t_0_st_0&);// ERROR -
t_0_st_1 ();
! };// ERROR -
struct t_0_st_0 {
int member;
--- 13,24 ----
struct t_0_st_0;
! struct t_0_st_1 { // ERROR -
int member;
t_0_st_1 (t_0_st_0&);// ERROR -
t_0_st_1 ();
! };
struct t_0_st_0 {
int member;
*************** void t_1_local_init ()
*** 80,91 ****
struct t_2_st_0;
! struct t_2_st_1 {
int member;
t_2_st_1 (t_2_st_0); // ERROR - candidate
t_2_st_1 ();
! }; // ERROR - candidate
struct t_2_st_0 {
int member;
--- 80,91 ----
struct t_2_st_0;
! struct t_2_st_1 { // ERROR - candidate
int member;
t_2_st_1 (t_2_st_0); // ERROR - candidate
t_2_st_1 ();
! };
struct t_2_st_0 {
int member;
Index: testsuite/g++.old-deja/g++.eh/spec6.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.eh/spec6.C,v
retrieving revision 1.5
diff -c -3 -p -r1.5 spec6.C
*** spec6.C 2001/01/03 14:39:10 1.5
--- spec6.C 2001/01/05 09:55:38
*************** struct B1 : A
*** 123,132 ****
};
struct C : A, A1
! {
virtual void foo() throw(int); // ERROR - looser throw - A::foo
virtual void bar() throw(int); // ERROR - looser throw - A1::bar
! }; // ERROR - looser throw - A::~A()
struct D : A, A1
{
--- 123,132 ----
};
struct C : A, A1
! { // ERROR - looser throw - A::~A()
virtual void foo() throw(int); // ERROR - looser throw - A::foo
virtual void bar() throw(int); // ERROR - looser throw - A1::bar
! };
struct D : A, A1
{
Index: testsuite/g++.old-deja/g++.jason/crash3.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.jason/crash3.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 crash3.C
*** crash3.C 1998/12/16 21:32:43 1.2
--- crash3.C 2001/01/05 09:55:38
***************
*** 3,11 ****
// Build don't link:
struct Node
! {
Node* child[2];
! }; // ERROR -
void bug(int i)
{
--- 3,11 ----
// Build don't link:
struct Node
! { // ERROR -
Node* child[2];
! };
void bug(int i)
{
Index: testsuite/g++.old-deja/g++.law/ctors11.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.law/ctors11.C,v
retrieving revision 1.4
diff -c -3 -p -r1.4 ctors11.C
*** ctors11.C 2000/01/04 15:52:23 1.4
--- ctors11.C 2001/01/05 09:55:38
*************** public:
*** 10,19 ****
inline A(int x){printf("constructing A with %d\n", x);}
};
! class B:public A{
private:
public:
! }; // ERROR - non-default constructor
int main()
{
--- 10,19 ----
inline A(int x){printf("constructing A with %d\n", x);}
};
! class B:public A{ // ERROR - non-default constructor
private:
public:
! };
int main()
{
Index: testsuite/g++.old-deja/g++.law/ctors17.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.law/ctors17.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ctors17.C
*** ctors17.C 1998/12/16 21:39:42 1.3
--- ctors17.C 2001/01/05 09:55:38
***************
*** 9,18 ****
#include <fstream.h>
! class X : public ifstream {
public:
X(int a, char *b) {} // ERROR - candidate
! }; // ERROR - candidate
int main()
{
X *y = new X(10, "123");
--- 9,18 ----
#include <fstream.h>
! class X : public ifstream { // ERROR - candidate
public:
X(int a, char *b) {} // ERROR - candidate
! };
int main()
{
X *y = new X(10, "123");
Index: testsuite/g++.old-deja/g++.law/ctors5.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.law/ctors5.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 ctors5.C
*** ctors5.C 1998/12/16 21:39:50 1.2
--- ctors5.C 2001/01/05 09:55:38
***************
*** 5,17 ****
// Date: Tue, 1 Sep 92 10:38:44 EDT
class X
! {
private:
int x;
public:
static const X x0;
X( int );
! }; // ERROR - candidate
class Y
{
--- 5,17 ----
// Date: Tue, 1 Sep 92 10:38:44 EDT
class X
! { // ERROR - candidate
private:
int x;
public:
static const X x0;
X( int );
! };
class Y
{
Index: testsuite/g++.old-deja/g++.law/ctors9.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.law/ctors9.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ctors9.C
*** ctors9.C 1998/12/16 21:39:54 1.3
--- ctors9.C 2001/01/05 09:55:38
*************** Foo::Foo(int aa)
*** 21,29 ****
struct var_Foo: public Foo
! {
var_Foo* operator-> () {return this;}
! };// ERROR - base.*// ERROR - in class.*
int blort(Foo& f)
{
--- 21,29 ----
struct var_Foo: public Foo
! { // ERROR - base.*// ERROR - in class.*
var_Foo* operator-> () {return this;}
! };
int blort(Foo& f)
{
Index: testsuite/g++.old-deja/g++.mike/ambig1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/ambig1.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ambig1.C
*** ambig1.C 1998/12/16 21:43:26 1.3
--- ambig1.C 2001/01/05 09:55:38
*************** class lM : public M {
*** 20,27 ****
class rM : public M {
};
! class D : public lM, rM {
! } d; // ERROR - ambiguous function
int main() {
((lM*)&d)->i = 1;
--- 20,27 ----
class rM : public M {
};
! class D : public lM, rM { // ERROR - ambiguous function
! } d;
int main() {
((lM*)&d)->i = 1;
Index: testsuite/g++.old-deja/g++.mike/net22.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/net22.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 net22.C
*** net22.C 1998/12/16 21:45:32 1.3
--- net22.C 2001/01/05 09:55:38
*************** public:
*** 4,11 ****
Parent( char *s ) {}
};
! class Child : public Parent {
! }; // ERROR - called
int main() {
Child c( "String initializer" ); // ERROR - bad
--- 4,11 ----
Parent( char *s ) {}
};
! class Child : public Parent { // ERROR - called
! };
int main() {
Child c( "String initializer" ); // ERROR - bad
Index: testsuite/g++.old-deja/g++.mike/p3538a.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/p3538a.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 p3538a.C
*** p3538a.C 1998/12/16 21:47:11 1.2
--- p3538a.C 2001/01/05 09:55:38
*************** class ccHandleBase : public ccObjectInfo
*** 25,33 ****
{};
class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo
! {
public:
virtual const ccObjectInfo& ri (int);
! }; // WARNING -
class ccCircleHdl : public ccHandle <cc_CircleHdl> {};
--- 25,33 ----
{};
class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo
! { // WARNING -
public:
virtual const ccObjectInfo& ri (int);
! };
class ccCircleHdl : public ccHandle <cc_CircleHdl> {};
Index: testsuite/g++.old-deja/g++.mike/p3538b.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/p3538b.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 p3538b.C
*** p3538b.C 1998/12/16 21:47:12 1.2
--- p3538b.C 2001/01/05 09:55:38
*************** class ccHandleBase : public ccObjectInfo
*** 27,35 ****
{};
class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo
! {
public:
virtual const ccObjectInfo& repInvariant (int);
! }; // WARNING -
class ccCircleHdl : public ccHandle <cc_CircleHdl> {};
--- 27,35 ----
{};
class cc_CircleHdl : public virtual ccHandleBase, public ccObjectInfo
! { // WARNING -
public:
virtual const ccObjectInfo& repInvariant (int);
! };
class ccCircleHdl : public ccHandle <cc_CircleHdl> {};
Index: testsuite/g++.old-deja/g++.mike/virt3.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/virt3.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 virt3.C
*** virt3.C 2000/04/06 16:30:42 1.3
--- virt3.C 2001/01/05 09:55:38
*************** class D : private B {
*** 10,17 ****
int Di;
};
! class E : public virtual D, public B {
int Ei;
! }; // WARNING - direct base inaccessible due to ambiguity
E e;
--- 10,17 ----
int Di;
};
! class E : public virtual D, public B { // WARNING - direct base inaccessible due to ambiguity
int Ei;
! };
E e;
Index: testsuite/g++.old-deja/g++.niklas/t128.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.niklas/t128.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 t128.C
*** t128.C 1998/12/16 21:49:56 1.2
--- t128.C 2001/01/05 09:55:38
***************
*** 1,5 ****
// Build don't link:
// GROUPS niklas uncaught default-construct
struct A { A (int); };
! struct B : A {}; // ERROR -
void f () { B (0); }// ERROR - .*
--- 1,5 ----
// Build don't link:
// GROUPS niklas uncaught default-construct
struct A { A (int); };
! struct B : A {}; // ERROR - without ctor // ERROR - candidates
void f () { B (0); }// ERROR - .*
Index: testsuite/g++.old-deja/g++.other/anon4.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.other/anon4.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 anon4.C
*** anon4.C 1999/09/04 15:09:05 1.2
--- anon4.C 2001/01/05 09:55:39
***************
*** 10,16 ****
struct A
{
union
! {
void bad();
! }; // ERROR - anon union cannot have member fns
};
--- 10,16 ----
struct A
{
union
! { // ERROR - anon union cannot have member fns
void bad();
! };
};
Index: testsuite/g++.old-deja/g++.other/using1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.other/using1.C,v
retrieving revision 1.3
diff -c -3 -p -r1.3 using1.C
*** using1.C 1998/12/16 21:53:43 1.3
--- using1.C 2001/01/05 09:55:39
*************** protected:
*** 9,26 ****
friend class D2;
};
! class D : public B {
public:
using B::a;
using B::b;
! }; // ERROR - within this context
! class D2 : public B {
public:
using B::a;
using B::b;
private:
using B::b;
! }; // ERROR - conflicting access specifications
--- 9,26 ----
friend class D2;
};
! class D : public B { // ERROR - within this context
public:
using B::a;
using B::b;
! };
! class D2 : public B { // ERROR - conflicting access specifications
public:
using B::a;
using B::b;
private:
using B::b;
! };
Index: testsuite/g++.old-deja/g++.other/warn3.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.other/warn3.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 warn3.C
*** warn3.C 1998/12/16 21:53:53 1.2
--- warn3.C 2001/01/05 09:55:39
*************** class A {
*** 4,54 ****
};
! class B {
public:
void f();
private:
B ();
B (const B&);
! }; // WARNING - only private constructors
! class C {
public:
void f();
private:
~C ();
! }; // WARNING - only private destructors
! class D {
private:
void f();
! }; // WARNING - all member functions are private
template <class T>
! class X {
private:
~X ();
! }; // WARNING - only private destructors
template class X<int>;
template class X<double>;
template <class T>
! class Y {
private:
Y ();
Y (const Y&);
! }; // WARNING - only private constructors
template <class T>
! class Z {
private:
void f();
! }; // WARNING - all member functions are private
--- 4,54 ----
};
! class B { // WARNING - only private constructors
public:
void f();
private:
B ();
B (const B&);
! };
! class C { // WARNING - only private destructors
public:
void f();
private:
~C ();
! };
! class D { // WARNING - all member functions are private
private:
void f();
! };
template <class T>
! class X { // WARNING - only private destructors
private:
~X ();
! };
template class X<int>;
template class X<double>;
template <class T>
! class Y { // WARNING - only private constructors
private:
Y ();
Y (const Y&);
! };
template <class T>
! class Z { // WARNING - all member functions are private
private:
void f();
! };
Index: testsuite/g++.old-deja/g++.pt/t37.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.pt/t37.C,v
retrieving revision 1.2
diff -c -3 -p -r1.2 t37.C
*** t37.C 1998/12/16 22:01:05 1.2
--- t37.C 2001/01/05 09:55:39
***************
*** 1,11 ****
// Build don't link:
! class A {
public:
A(int); // ERROR - referenced below
A(float); // ERROR - referenced below
~A();
! }; // ERROR - synthesized copy ctor
A::A() { // ERROR -
}
--- 1,11 ----
// Build don't link:
! class A { // ERROR - synthesized copy ctor
public:
A(int); // ERROR - referenced below
A(float); // ERROR - referenced below
~A();
! };
A::A() { // ERROR -
}
Index: testsuite/g++.old-deja/g++.robertl/eb69.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C,v
retrieving revision 1.4
diff -c -3 -p -r1.4 eb69.C
*** eb69.C 2000/07/04 07:47:11 1.4
--- eb69.C 2001/01/05 09:55:39
***************
*** 4,12 ****
int r = 0;
! struct foo {
foo(int x) { r = 1; } // ERROR - candidate
! }; // ERROR - candidate
struct bar : foo {
typedef int an_int;
--- 4,12 ----
int r = 0;
! struct foo { // ERROR - candidate
foo(int x) { r = 1; } // ERROR - candidate
! };
struct bar : foo {
typedef int an_int;
Index: testsuite/g++.old-deja/g++.robertl/eb71.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C,v
retrieving revision 1.4
diff -c -3 -p -r1.4 eb71.C
*** eb71.C 1998/12/16 22:04:31 1.4
--- eb71.C 2001/01/05 09:55:40
*************** friend class D;
*** 15,24 ****
unsigned counter;
};
! class D {
int ins( B*&);
! }; //WARNING - only private members
int
D::ins( B*& tempN)
--- 15,24 ----
unsigned counter;
};
! class D { //WARNING - only private members
int ins( B*&);
! };
int
D::ins( B*& tempN)