Fix C++ testsuite failures.

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Mar 8 00:48:00 GMT 2006


"Lee Millward" <lee.millward@gmail.com> writes:

| This patch addresses those C++ testsuite failures caused by my patch
| on 2006-02-03 by adding the relevant dg-warning markers to the tests
| in question. I completely forgot about these failures until Andrew
| Pinski's recent message requesting a testsuite regression period
| reminded me. My sincere apologies for any inconvienience in the
| meantime.
| 
| Ok to apply?

I don't think putting the dg-warning is how to fix these issues.

[...]

| Index: g++.old-deja/g++.brendan/warnings4.C
| ===================================================================
| --- g++.old-deja/g++.brendan/warnings4.C	(revision 111789)
| +++ g++.old-deja/g++.brendan/warnings4.C	(working copy)
| @@ -4,7 +4,7 @@ int
|  main ()
|  {
|    register int x;
| -  int * foo = &x; // in C++ it's perfectly legal to do this
| +  int * foo = &x; // in C++ it's perfectly legal to do this {
| dg-warning "address requested" }

I don't understand.  The warning is bogus -- I think you should fill a
bugzilla PR for this.

[...]

|  class X {
| -  int & flag;
| +  int & flag; /* { dg-warning "non-static reference" } */

have the reference initialized from something.
 
|  public:
|    void f(){ flag++ ; }
|  };
| Index: g++.old-deja/g++.mike/p11110.C
| ===================================================================
| --- g++.old-deja/g++.mike/p11110.C	(revision 111789)
| +++ g++.old-deja/g++.mike/p11110.C	(working copy)
| @@ -13,7 +13,7 @@ class user {
|  public:
|    data* data1 () const;
|  private:
| -  conatiner& _c;
| +  conatiner& _c; // { dg-warning "non-static reference" }
|  };

Likewise.

|  data* user::data1() const {
| Index: g++.dg/init/ctor4.C
| ===================================================================
| --- g++.dg/init/ctor4.C	(revision 111789)
| +++ g++.dg/init/ctor4.C	(working copy)
| @@ -8,7 +8,7 @@ public:
| 
|  class bar: public foo {// { dg-error "uninitialized" }
|  private:
| -  int &a;
| +  int &a; // { dg-warning "non-static reference" }

Likewise.

|  };
| 
|  foo::foo() {
| Index: g++.dg/parse/register1.C
| ===================================================================
| --- g++.dg/parse/register1.C	(revision 111789)
| +++ g++.dg/parse/register1.C	(working copy)
| @@ -10,5 +10,5 @@ public:
| 
|  C f (register C x)
|  {
| -  return x + 31;
| +  return x + 31; /* { dg-warning "address requested" } */

fill a PR for this.

-- Gaby



More information about the Gcc-patches mailing list