diff mbox

[C++] Emit error + inform for access control issues

Message ID 5523F58C.5050908@oracle.com
State New
Headers show

Commit Message

Paolo Carlini April 7, 2015, 3:19 p.m. UTC
... thus I prepared the below. I tried to minimize the diagnostic 
changes but a few more testcases needed tweaking anyway.

Thanks!
Paolo.

///////////////////////

Comments

Paolo Carlini April 15, 2015, 8:48 a.m. UTC | #1
Hi,

On 04/07/2015 05:19 PM, Paolo Carlini wrote:
> ... thus I prepared the below. I tried to minimize the diagnostic 
> changes but a few more testcases needed tweaking anyway.
Is this version Ok for the trunk?

     https://gcc.gnu.org/ml/gcc-patches/2015-04/msg00260.html

Thanks,
Paolo.
Jason Merrill April 15, 2015, 1:21 p.m. UTC | #2
Sorry, thought I had responded to this.  OK.

Jason
diff mbox

Patch

Index: cp/call.c
===================================================================
--- cp/call.c	(revision 221871)
+++ cp/call.c	(working copy)
@@ -6020,12 +6020,22 @@  enforce_access (tree basetype_path, tree decl, tre
       if (complain & tf_error)
 	{
 	  if (TREE_PRIVATE (decl))
-	    error ("%q+#D is private", diag_decl);
+	    {
+	      error ("%q#D is private within this context", diag_decl);
+	      inform (DECL_SOURCE_LOCATION (diag_decl),
+		      "declared private here");
+	    }
 	  else if (TREE_PROTECTED (decl))
-	    error ("%q+#D is protected", diag_decl);
+	    {
+	      error ("%q#D is protected within this context", diag_decl);
+	      inform (DECL_SOURCE_LOCATION (diag_decl),
+		      "declared protected here");
+	    }
 	  else
-	    error ("%q+#D is inaccessible", diag_decl);
-	  error ("within this context");
+	    {
+	      error ("%q#D is inaccessible within this context", diag_decl);
+	      inform (DECL_SOURCE_LOCATION (diag_decl), "declared here");
+	    }
 	}
       return false;
     }
Index: testsuite/g++.dg/cpp0x/alias-decl-22.C
===================================================================
--- testsuite/g++.dg/cpp0x/alias-decl-22.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/alias-decl-22.C	(working copy)
@@ -7,6 +7,6 @@  using foo = typename T::bar;	// { dg-error "this c
 
 class B
 {
-  typedef int bar;		// { dg-error "private" }
+  typedef int bar;		// { dg-message "private" }
   foo<B> f;			// { dg-message "required" }
 };
Index: testsuite/g++.dg/cpp0x/decltype-call1.C
===================================================================
--- testsuite/g++.dg/cpp0x/decltype-call1.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/decltype-call1.C	(working copy)
@@ -17,7 +17,7 @@  decltype(45,f(),42) g4b();	 // { dg-error "" }
 
 class B
 {
-  ~B();				// { dg-error "private" }
+  ~B();				// { dg-message "private" }
 public:
   int i;
   void operator[](int);
Index: testsuite/g++.dg/cpp0x/defaulted21.C
===================================================================
--- testsuite/g++.dg/cpp0x/defaulted21.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/defaulted21.C	(working copy)
@@ -4,7 +4,7 @@ 
 struct U {
   U();
 private:
-  U(U const&);			// { dg-error "private" }
+  U(U const&);			// { dg-message "private" }
 };
 
 struct X {
Index: testsuite/g++.dg/cpp0x/defaulted28.C
===================================================================
--- testsuite/g++.dg/cpp0x/defaulted28.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/defaulted28.C	(working copy)
@@ -6,7 +6,7 @@  struct A {
   A() = default;
 
 private:
-  A(A const&) = default;	// { dg-error "private" }
+  A(A const&) = default;	// { dg-message "private" }
 };
 
 int f(...) { }
Index: testsuite/g++.dg/cpp0x/defaulted47.C
===================================================================
--- testsuite/g++.dg/cpp0x/defaulted47.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/defaulted47.C	(working copy)
@@ -3,7 +3,7 @@ 
 
 class A
 {
-  A() = default;   // { dg-error "private" }
+  A() = default;   // { dg-message "private" }
 };
 
 A a;               // { dg-error "context" }
@@ -10,7 +10,7 @@  A a;               // { dg-error "context" }
 
 class B
 {
-  ~B() = default;  // { dg-error "private" }
+  ~B() = default;  // { dg-message "private" }
 };
 
 B b;               // { dg-error "context" }
Index: testsuite/g++.dg/cpp0x/elision_neg.C
===================================================================
--- testsuite/g++.dg/cpp0x/elision_neg.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/elision_neg.C	(working copy)
@@ -12,7 +12,7 @@  struct two   {char x[2];};
 
 class move_only
 {
-    move_only(const move_only&); // { dg-error "is private" }
+    move_only(const move_only&); // { dg-message "private" }
     move_only& operator=(const move_only&);
 public:
     move_only() {}
Index: testsuite/g++.dg/cpp0x/fntmpdefarg3.C
===================================================================
--- testsuite/g++.dg/cpp0x/fntmpdefarg3.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/fntmpdefarg3.C	(working copy)
@@ -8,7 +8,7 @@  template <class T, class = typename T::I> void j(T
 
 class A
 {
-  typedef int I;		// { dg-error "private" }
+  typedef int I;		// { dg-message "private" }
   template <class T, class> friend void f(T);
   friend void g<A,I>(A);
   friend void h<A>(A);
Index: testsuite/g++.dg/cpp0x/implicit-trivial1.C
===================================================================
--- testsuite/g++.dg/cpp0x/implicit-trivial1.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/implicit-trivial1.C	(working copy)
@@ -8,7 +8,7 @@  struct A
 {
   A() {}
 private:
-  template <class T> A(T&);	// { dg-error "private" }
+  template <class T> A(T&);	// { dg-message "private" }
 };
 
 struct B			// { dg-error "implicitly deleted|this context" }
Index: testsuite/g++.dg/cpp0x/implicit1.C
===================================================================
--- testsuite/g++.dg/cpp0x/implicit1.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/implicit1.C	(working copy)
@@ -5,7 +5,7 @@ 
 
 class C
 {
-  void operator delete (void *); // { dg-error "private" }
+  void operator delete (void *); // { dg-message "private" }
 public:
   virtual ~C();			// { dg-error "overriding" }
 };
Index: testsuite/g++.dg/cpp0x/implicit9.C
===================================================================
--- testsuite/g++.dg/cpp0x/implicit9.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/implicit9.C	(working copy)
@@ -5,7 +5,7 @@  struct A
 {
   A();
 private:
-  ~A();				// { dg-error "private" }
+  ~A();				// { dg-message "private" }
 };
 
 struct B: A { };		// { dg-error "implicitly deleted|context" }
Index: testsuite/g++.dg/cpp0x/inh-ctor9.C
===================================================================
--- testsuite/g++.dg/cpp0x/inh-ctor9.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/inh-ctor9.C	(working copy)
@@ -9,7 +9,7 @@  class A
 
 struct B: A
 {
-  using A::A;			// { dg-error "protected" }
+  using A::A;			// { dg-message "protected" }
 };
 
 B b(42);			// { dg-error "this context" }
Index: testsuite/g++.dg/cpp0x/range-for13.C
===================================================================
--- testsuite/g++.dg/cpp0x/range-for13.C	(revision 221871)
+++ testsuite/g++.dg/cpp0x/range-for13.C	(working copy)
@@ -28,8 +28,8 @@  struct container2
 struct container3
 {
 private:
-    int *begin(); // { dg-error "is private" }
-    int *end(); // { dg-error "is private" }
+    int *begin(); // { dg-message "private" }
+    int *end(); // { dg-message "private" }
 };
 
 struct container4
@@ -70,7 +70,7 @@  struct container8
 struct private_callable
 {
 private:
-    int *operator()(); // { dg-error "is private" }
+    int *operator()(); // { dg-message "private" }
 };
 
 struct container9
Index: testsuite/g++.dg/gomp/clause-2.C
===================================================================
--- testsuite/g++.dg/gomp/clause-2.C	(revision 221871)
+++ testsuite/g++.dg/gomp/clause-2.C	(working copy)
@@ -5,9 +5,9 @@  struct B { B(); };
 struct C { C(); C(const C&); };
 struct D { D& operator=(const D&); };
 
-class E { private: E(); public: E(int); };	// { dg-error "private" }
-class F { private: F(const F&); public: F(); };	// { dg-error "private" }
-class G { private: G& operator=(const G&); };	// { dg-error "private" }
+class E { private: E(); public: E(int); };	// { dg-message "private" }
+class F { private: F(const F&); public: F(); };	// { dg-message "private" }
+class G { private: G& operator=(const G&); };	// { dg-message "private" }
 
 void bar();
 void foo()
Index: testsuite/g++.dg/gomp/udr-5.C
===================================================================
--- testsuite/g++.dg/gomp/udr-5.C	(revision 221871)
+++ testsuite/g++.dg/gomp/udr-5.C	(working copy)
@@ -5,9 +5,9 @@  struct S
   int s;
   S () : s (0) {}
 private:
-  #pragma omp declare reduction (+:S:omp_out.s += omp_in.s)	// { dg-error "is private" }
+  #pragma omp declare reduction (+:S:omp_out.s += omp_in.s)	// { dg-message "private" }
 protected:
-  #pragma omp declare reduction (-:S:omp_out.s += omp_in.s)	// { dg-error "is protected" }
+  #pragma omp declare reduction (-:S:omp_out.s += omp_in.s)	// { dg-message "protected" }
 };
 
 struct T : public S
Index: testsuite/g++.dg/inherit/access6.C
===================================================================
--- testsuite/g++.dg/inherit/access6.C	(revision 221871)
+++ testsuite/g++.dg/inherit/access6.C	(working copy)
@@ -1,9 +1,9 @@ 
 // PR c++/28588
 
 class Foo { 
-  static void f(); // { dg-error "private" }
+  static void f(); // { dg-message "private" }
   static void f(int);
-  static void g(); // { dg-error "private" }
+  static void g(); // { dg-message "private" }
 };
 
 void h()
Index: testsuite/g++.dg/lookup/duperr1.C
===================================================================
--- testsuite/g++.dg/lookup/duperr1.C	(revision 221871)
+++ testsuite/g++.dg/lookup/duperr1.C	(working copy)
@@ -1,5 +1,5 @@ 
 // PR c++/29048
 
 class A { int i; }; // { dg-bogus "is private.*is private" }
-// { dg-error "is private" "" { target *-*-* } 3 }
+// { dg-message "private" "" { target *-*-* } 3 }
 class B:public A { B() { A::i=0; } }; // { dg-error "within this context" }
Index: testsuite/g++.dg/lookup/friend2.C
===================================================================
--- testsuite/g++.dg/lookup/friend2.C	(revision 221871)
+++ testsuite/g++.dg/lookup/friend2.C	(working copy)
@@ -12,7 +12,7 @@  struct S {
 namespace NS {
   class X {
       friend class S;
-      static int *i;	// { dg-error "private" }
+      static int *i;	// { dg-message "private" }
   };
 }
 
Index: testsuite/g++.dg/lookup/pr6936.C
===================================================================
--- testsuite/g++.dg/lookup/pr6936.C	(revision 221871)
+++ testsuite/g++.dg/lookup/pr6936.C	(working copy)
@@ -3,7 +3,7 @@ 
 
 struct Baser
 {
-    enum { j, i }; // { dg-error "inaccessible" }
+    enum { j, i }; // { dg-message "declared" }
 };
 
 struct Base : Baser
Index: testsuite/g++.dg/lookup/scoped1.C
===================================================================
--- testsuite/g++.dg/lookup/scoped1.C	(revision 221871)
+++ testsuite/g++.dg/lookup/scoped1.C	(working copy)
@@ -4,7 +4,7 @@ 
 struct A
 {
   static int i1;
-  int i2; // { dg-error "inaccessible" "" }
+  int i2; // { dg-message "declared" "" }
   static void f1 ();
   void f2 ();
 };
Index: testsuite/g++.dg/lookup/using26.C
===================================================================
--- testsuite/g++.dg/lookup/using26.C	(revision 221871)
+++ testsuite/g++.dg/lookup/using26.C	(working copy)
@@ -9,7 +9,7 @@  struct A
 struct B
 {
 private:
-    int next; // { dg-error "private" }
+    int next; // { dg-message "private" }
 };
 
 struct C
Index: testsuite/g++.dg/lookup/using38.C
===================================================================
--- testsuite/g++.dg/lookup/using38.C	(revision 221871)
+++ testsuite/g++.dg/lookup/using38.C	(working copy)
@@ -3,7 +3,7 @@ 
 
 struct Baser
 {
-    enum { j, i }; // { dg-error "inaccessible" }
+    enum { j, i }; // { dg-message "declared" }
 };
 
 struct Base : Baser
Index: testsuite/g++.dg/other/access2.C
===================================================================
--- testsuite/g++.dg/other/access2.C	(revision 221871)
+++ testsuite/g++.dg/other/access2.C	(working copy)
@@ -18,7 +18,7 @@  class Derived : public Base {
   void test();
 };
 
-int Base::fooprivate=42;	// { dg-error "private" }
+int Base::fooprivate=42;	// { dg-message "private" }
 int Base::fooprotected=42;
 int Base::foopublic=42;
 
Index: testsuite/g++.dg/overload/defarg3.C
===================================================================
--- testsuite/g++.dg/overload/defarg3.C	(revision 221871)
+++ testsuite/g++.dg/overload/defarg3.C	(working copy)
@@ -3,7 +3,7 @@ 
 
 class C {
 private:
-  static int f(int); // { dg-error "private" }
+  static int f(int); // { dg-message "private" }
   static int f(char);
 };
 
Index: testsuite/g++.dg/overload/defarg6.C
===================================================================
--- testsuite/g++.dg/overload/defarg6.C	(revision 221871)
+++ testsuite/g++.dg/overload/defarg6.C	(working copy)
@@ -1,7 +1,7 @@ 
 class A
 {
   int i;
-  A(int i): i(i) {}		// { dg-error "private" }
+  A(int i): i(i) {}		// { dg-message "private" }
 };
 
 void f (A = 1) { }		// { dg-error "context" }
Index: testsuite/g++.dg/parse/access11.C
===================================================================
--- testsuite/g++.dg/parse/access11.C	(revision 221871)
+++ testsuite/g++.dg/parse/access11.C	(working copy)
@@ -2,24 +2,24 @@ 
 
 class A {
   union {
-    int i;       // { dg-error "private" }
+    int i;       // { dg-message "private" }
   };
   union {
-    int j;       // { dg-error "private" }
+    int j;       // { dg-message "private" }
   }; 
   union {
     union {
-      int k;     // { dg-error "private" }
+      int k;     // { dg-message "private" }
     };
     union {
       union {
-	int l;   // { dg-error "private" }
+	int l;   // { dg-message "private" }
       };
       union {
-	int m;   // { dg-error "private" }
+	int m;   // { dg-message "private" }
 	union {
-	  int n; // { dg-error "private" }
-	  int o; // { dg-error "private" }
+	  int n; // { dg-message "private" }
+	  int o; // { dg-message "private" }
 	};
       };
     };
Index: testsuite/g++.dg/parse/access2.C
===================================================================
--- testsuite/g++.dg/parse/access2.C	(revision 221871)
+++ testsuite/g++.dg/parse/access2.C	(working copy)
@@ -5,7 +5,7 @@ 
 // Deferred access checking of variable declaration.
 
 class A {
-  typedef int X;	// { dg-error "private" }
+  typedef int X;	// { dg-message "private" }
   static X a, b, c;
 };
 
Index: testsuite/g++.dg/parse/access3.C
===================================================================
--- testsuite/g++.dg/parse/access3.C	(revision 221871)
+++ testsuite/g++.dg/parse/access3.C	(working copy)
@@ -6,7 +6,7 @@ 
 
 class A {
 private:
-  void f();		// { dg-error "private" }
+  void f();		// { dg-message "private" }
 };
 
 class B {
Index: testsuite/g++.dg/parse/access4.C
===================================================================
--- testsuite/g++.dg/parse/access4.C	(revision 221871)
+++ testsuite/g++.dg/parse/access4.C	(working copy)
@@ -6,7 +6,7 @@ 
 
 class A {
 protected:
-  void foo() {}			// { dg-error "protected" }
+  void foo() {}			// { dg-message "protected" }
 public:
   A();
 };
Index: testsuite/g++.dg/parse/access5.C
===================================================================
--- testsuite/g++.dg/parse/access5.C	(revision 221871)
+++ testsuite/g++.dg/parse/access5.C	(working copy)
@@ -7,7 +7,7 @@ 
 struct A 
 {
 protected:
-  int a;			// { dg-error "protected" }
+  int a;			// { dg-message "protected" }
 };
 
 struct B : A 
Index: testsuite/g++.dg/parse/access6.C
===================================================================
--- testsuite/g++.dg/parse/access6.C	(revision 221871)
+++ testsuite/g++.dg/parse/access6.C	(working copy)
@@ -8,7 +8,7 @@ 
 class A
 {
   public:
-    int foo() { return 1; }	// { dg-error "inaccessible" }
+    int foo() { return 1; }	// { dg-message "declared" }
 };
 
 class B : public A
Index: testsuite/g++.dg/parse/access8.C
===================================================================
--- testsuite/g++.dg/parse/access8.C	(revision 221871)
+++ testsuite/g++.dg/parse/access8.C	(working copy)
@@ -2,7 +2,7 @@ 
 
 class foo
 {
-  typedef int memfun;  // { dg-error "private" }
+  typedef int memfun;  // { dg-message "private" }
 };
 
 template<foo::memfun> // { dg-error "context" }
Index: testsuite/g++.dg/parse/access9.C
===================================================================
--- testsuite/g++.dg/parse/access9.C	(revision 221871)
+++ testsuite/g++.dg/parse/access9.C	(working copy)
@@ -1,5 +1,5 @@ 
 // PR c++/24782
 
 class Foo { public:  typedef int type1; };
-class Bar { private: typedef Foo type2; }; // { dg-error "private" } 
+class Bar { private: typedef Foo type2; }; // { dg-message "private" } 
 void g(Bar::type2::type1) {} // { dg-error "context" }
Index: testsuite/g++.dg/parse/crash40.C
===================================================================
--- testsuite/g++.dg/parse/crash40.C	(revision 221871)
+++ testsuite/g++.dg/parse/crash40.C	(working copy)
@@ -10,7 +10,7 @@  struct C : A {};
 
 class AA
 {
-  template<int> void foo(); /* { dg-error "is private" } */
+  template<int> void foo(); /* { dg-message "private" } */
 };
 struct BB : AA {};
 
@@ -20,7 +20,7 @@  class AAA {
 struct BBB {
   static BBB *foo();
 private:
-  int get() const {} /* { dg-error "is private" } */
+  int get() const {} /* { dg-message "private" } */
 };
 template<bool> struct S {
   S(unsigned int = BBB::foo()->AAA::get()); /* { dg-error "is not a base of" } */
Index: testsuite/g++.dg/tc1/dr142.C
===================================================================
--- testsuite/g++.dg/tc1/dr142.C	(revision 221871)
+++ testsuite/g++.dg/tc1/dr142.C	(working copy)
@@ -2,10 +2,10 @@ 
 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
 // DR142: Injection-related errors in access example 
 
-class B {                 // { dg-error "inaccessible" }
+class B {                 // { dg-message "declared" }
 public:
-  int mi;                 // { dg-error "inaccessible" }
-  static int si;          // { dg-error "inaccessible" }
+  int mi;                 // { dg-message "declared" }
+  static int si;          // { dg-message "declared" }
 };
 
 class D: private B {
Index: testsuite/g++.dg/tc1/dr166.C
===================================================================
--- testsuite/g++.dg/tc1/dr166.C	(revision 221871)
+++ testsuite/g++.dg/tc1/dr166.C	(working copy)
@@ -9,17 +9,17 @@  namespace N {
   namespace M {
     class A {
       friend void f<int>(int); // N::f
-      static int x;   // { dg-error "private" }
+      static int x;   // { dg-message "private" }
     };
     
     class B {
       template <class T> friend void f(T);  // M::f
-      static int x;   // { dg-error "private" }
+      static int x;   // { dg-message "private" }
     };
 
     class C {
       friend void g(); // M::g
-      static int x;   // { dg-error "private" }
+      static int x;   // { dg-message "private" }
     };
 
     template <class T> void f(T)  // will be instantiated as f<long>
Index: testsuite/g++.dg/tc1/dr52.C
===================================================================
--- testsuite/g++.dg/tc1/dr52.C	(revision 221871)
+++ testsuite/g++.dg/tc1/dr52.C	(working copy)
@@ -17,7 +17,7 @@  struct B1 : B {};
 struct B2 : B {};
 
 struct C
-{ // { dg-error "C" }
+{ // { dg-message "declared" }
   void foo(void);
 };
 
Index: testsuite/g++.dg/template/access11.C
===================================================================
--- testsuite/g++.dg/template/access11.C	(revision 221871)
+++ testsuite/g++.dg/template/access11.C	(working copy)
@@ -5,7 +5,7 @@ 
 // Access checking during explicit instantiation.
 
 class A {
-  typedef int X;		// { dg-error "private" }
+  typedef int X;		// { dg-message "private" }
 };
 
 class X {
Index: testsuite/g++.dg/template/access18.C
===================================================================
--- testsuite/g++.dg/template/access18.C	(revision 221871)
+++ testsuite/g++.dg/template/access18.C	(working copy)
@@ -1,10 +1,10 @@ 
 // DR 401
 
 class X {
-  typedef int a; // { dg-error "private" }
-  static const int b = 5; // { dg-error "private" }
+  typedef int a; // { dg-message "private" }
+  static const int b = 5; // { dg-message "private" }
   template <typename>
-  struct c; // { dg-error "private" }
+  struct c; // { dg-message "private" }
 };
 
 template <typename = X::a> // { dg-error "context" }
Index: testsuite/g++.dg/template/access19.C
===================================================================
--- testsuite/g++.dg/template/access19.C	(revision 221871)
+++ testsuite/g++.dg/template/access19.C	(working copy)
@@ -9,7 +9,7 @@  class explicit_t
         operator T&() { return value; }
 private:
         template< class U >
-        explicit_t( U t ); /* { dg-error "with U = char, T = int|is private" } */
+        explicit_t( U t ); /* { dg-message "with U = char, T = int|private" } */
         T value;
 };
 
Index: testsuite/g++.dg/template/access2.C
===================================================================
--- testsuite/g++.dg/template/access2.C	(revision 221871)
+++ testsuite/g++.dg/template/access2.C	(working copy)
@@ -9,8 +9,8 @@  template <class T> struct A {
 };
 
 class B {
-  typedef int X;			// { dg-error "private" }
-  static int i;				// { dg-error "private" }
+  typedef int X;			// { dg-message "private" }
+  static int i;				// { dg-message "private" }
 };
 
 int main()
Index: testsuite/g++.dg/template/access20.C
===================================================================
--- testsuite/g++.dg/template/access20.C	(revision 221871)
+++ testsuite/g++.dg/template/access20.C	(working copy)
@@ -3,7 +3,7 @@ 
 template <typename T> struct B
 {
         protected:
-        T v;			// { dg-error "protected" }
+        T v;			// { dg-message "protected" }
 };
 template <typename T> struct D : B<T>
 {
Index: testsuite/g++.dg/template/access26.C
===================================================================
--- testsuite/g++.dg/template/access26.C	(revision 221871)
+++ testsuite/g++.dg/template/access26.C	(working copy)
@@ -2,5 +2,5 @@ 
 
 template < typename T >
 struct A { static int i; };
-class B { typedef int X; };	// { dg-error "private" }
+class B { typedef int X; };	// { dg-message "private" }
 void f() { A<B::X>::i = 0; }	// { dg-error "this context" }
Index: testsuite/g++.dg/template/access3.C
===================================================================
--- testsuite/g++.dg/template/access3.C	(revision 221871)
+++ testsuite/g++.dg/template/access3.C	(working copy)
@@ -8,7 +8,7 @@  template <class T> struct A {
 };
 
 class B {
-  template <class T> class X {};	// { dg-error "private" }
+  template <class T> class X {};	// { dg-message "private" }
 };
 
 int main()
Index: testsuite/g++.dg/template/access7.C
===================================================================
--- testsuite/g++.dg/template/access7.C	(revision 221871)
+++ testsuite/g++.dg/template/access7.C	(working copy)
@@ -5,7 +5,7 @@ 
 
 template <typename A>
 class S {
-  class T {};				// { dg-error "private" }
+  class T {};				// { dg-message "private" }
 };
 
 template <typename A>
Index: testsuite/g++.dg/template/conv12.C
===================================================================
--- testsuite/g++.dg/template/conv12.C	(revision 221871)
+++ testsuite/g++.dg/template/conv12.C	(working copy)
@@ -16,7 +16,7 @@  struct C2
 {
 private:
   template <class T>
-  operator T();			// { dg-error "private" }
+  operator T();			// { dg-message "private" }
 public:
   operator bool() { return false; }
 } c2;
Index: testsuite/g++.dg/template/crash69.C
===================================================================
--- testsuite/g++.dg/template/crash69.C	(revision 221871)
+++ testsuite/g++.dg/template/crash69.C	(working copy)
@@ -2,7 +2,7 @@ 
 
 template<typename T> class A
 {
-  static int i; // { dg-error "is private" }
+  static int i; // { dg-message "private" }
   friend int T::foo(); // { dg-error "does not match" }
 };
 
Index: testsuite/g++.dg/template/friend31.C
===================================================================
--- testsuite/g++.dg/template/friend31.C	(revision 221871)
+++ testsuite/g++.dg/template/friend31.C	(working copy)
@@ -10,7 +10,7 @@  template <typename T, typename U> struct F; // { d
 class W
 {
   template<int i> friend class F;	// { dg-error "template parameter" }
-  int x;                                // { dg-error "private" }
+  int x;                                // { dg-message "private" }
 };
 
 template <typename T, typename U> struct F
Index: testsuite/g++.dg/template/friend32.C
===================================================================
--- testsuite/g++.dg/template/friend32.C	(revision 221871)
+++ testsuite/g++.dg/template/friend32.C	(working copy)
@@ -7,7 +7,7 @@ 
 
 template<class T> class A
 {
-  void f ();			// { dg-error "private" }
+  void f ();			// { dg-message "private" }
 };
 
 template<class T> class B
Index: testsuite/g++.dg/template/memfriend15.C
===================================================================
--- testsuite/g++.dg/template/memfriend15.C	(revision 221871)
+++ testsuite/g++.dg/template/memfriend15.C	(working copy)
@@ -17,7 +17,7 @@  template<class T> struct A
 };
 
 class C {
-  int i;	// { dg-error "private" }
+  int i;	// { dg-message "private" }
   template<class T> friend struct A<T>::B1;
 };
 
Index: testsuite/g++.dg/template/memfriend16.C
===================================================================
--- testsuite/g++.dg/template/memfriend16.C	(revision 221871)
+++ testsuite/g++.dg/template/memfriend16.C	(working copy)
@@ -17,7 +17,7 @@  template<class T> struct A
 };
 
 class C {
-  int i;	// { dg-error "private" }
+  int i;	// { dg-message "private" }
   template<class T> template <class U> friend struct A<T>::B1;
 };
 
Index: testsuite/g++.dg/template/memfriend17.C
===================================================================
--- testsuite/g++.dg/template/memfriend17.C	(revision 221871)
+++ testsuite/g++.dg/template/memfriend17.C	(working copy)
@@ -18,7 +18,7 @@  template<typename Q>
 class F1
 {
     friend class A<Q>::B;
-    enum { foo = 0 };	// { dg-error "private" }
+    enum { foo = 0 };	// { dg-message "private" }
 };
 
 template<typename Q>
Index: testsuite/g++.dg/template/memfriend7.C
===================================================================
--- testsuite/g++.dg/template/memfriend7.C	(revision 221871)
+++ testsuite/g++.dg/template/memfriend7.C	(working copy)
@@ -15,7 +15,7 @@  template <class T> struct A {
 };
 
 class C {
-  int ii;				// { dg-error "private" }
+  int ii;				// { dg-message "private" }
   template <class U> template <class V>
     friend void A<U>::f(V);
   template <class U> friend void A<U>::g();
Index: testsuite/g++.dg/template/pr32519.C
===================================================================
--- testsuite/g++.dg/template/pr32519.C	(revision 221871)
+++ testsuite/g++.dg/template/pr32519.C	(working copy)
@@ -4,7 +4,7 @@ 
 struct B
 {
 protected:
-  template <class T> void f (); // { dg-error "protected" }
+  template <class T> void f (); // { dg-message "protected" }
 };
 
 struct D : public B
Index: testsuite/g++.dg/template/qualttp21.C
===================================================================
--- testsuite/g++.dg/template/qualttp21.C	(revision 221871)
+++ testsuite/g++.dg/template/qualttp21.C	(working copy)
@@ -8,7 +8,7 @@  class foo {
 public:
    foo() {}
 protected:
-   ~foo() {} // { dg-error "~foo" }
+   ~foo() {} // { dg-message "protected" }
 };
 
 int main()
Index: testsuite/g++.dg/template/qualttp8.C
===================================================================
--- testsuite/g++.dg/template/qualttp8.C	(revision 221871)
+++ testsuite/g++.dg/template/qualttp8.C	(working copy)
@@ -11,7 +11,7 @@  template <class T> struct D {
 
 struct E {
 	private:
-	template <class T> class B {}; // { dg-error "private" }
+	template <class T> class B {}; // { dg-message "private" }
 };
 
 D<E> d; // { dg-message "required" }
Index: testsuite/g++.dg/template/ttp10.C
===================================================================
--- testsuite/g++.dg/template/ttp10.C	(revision 221871)
+++ testsuite/g++.dg/template/ttp10.C	(working copy)
@@ -9,8 +9,8 @@  template <typename> struct Template {};
  
 template<template<typename> class D> 
 struct B { 
-    static void foo1(const D<void> *);	// { dg-error "const" }
-    static void foo2(volatile D<void> *);// { dg-error "volatile" }
+    static void foo1(const D<void> *);	// { dg-message "declared" }
+    static void foo2(volatile D<void> *);// { dg-message "declared" }
 }; 
  
 class E : protected B<Template> {}; 
Index: testsuite/g++.dg/template/typedef11.C
===================================================================
--- testsuite/g++.dg/template/typedef11.C	(revision 221871)
+++ testsuite/g++.dg/template/typedef11.C	(working copy)
@@ -5,13 +5,13 @@ 
 
 class Alpha
 {
-  typedef int X; // { dg-error "'typedef int Alpha::X' is private" }
+  typedef int X; // { dg-message "private" }
 };
 
 template<int>
 class Beta
 {
-    typedef int Y; // { dg-error "'typedef int Beta<0>::Y' is private" }
+    typedef int Y; // { dg-message "private" }
 };
 
 template <int>
Index: testsuite/g++.dg/template/typedef13.C
===================================================================
--- testsuite/g++.dg/template/typedef13.C	(revision 221871)
+++ testsuite/g++.dg/template/typedef13.C	(working copy)
@@ -4,7 +4,7 @@ 
 
 class A
 {
-  typedef int mytype; // { dg-error "typedef int A::mytype' is private" }
+  typedef int mytype; // { dg-message "private" }
 };
 
 template <class T> class B : public A
Index: testsuite/g++.dg/template/typedef19.C
===================================================================
--- testsuite/g++.dg/template/typedef19.C	(revision 221871)
+++ testsuite/g++.dg/template/typedef19.C	(working copy)
@@ -4,7 +4,7 @@ 
 
 class A
 {
-  typedef int mytype; // { dg-error "'typedef int A::mytype' is private" }
+  typedef int mytype; // { dg-message "private" }
 };
 
 template <class T>
Index: testsuite/g++.dg/template/typedef20.C
===================================================================
--- testsuite/g++.dg/template/typedef20.C	(revision 221871)
+++ testsuite/g++.dg/template/typedef20.C	(working copy)
@@ -4,7 +4,7 @@ 
 
 class x
 {
-  typedef int privtype; // { dg-error "is private" }
+  typedef int privtype; // { dg-message "private" }
 
 protected:
   typedef int type;
Index: testsuite/g++.dg/template/typedef22.C
===================================================================
--- testsuite/g++.dg/template/typedef22.C	(revision 221871)
+++ testsuite/g++.dg/template/typedef22.C	(working copy)
@@ -6,7 +6,7 @@  template <typename T>
 struct B
 {
 protected:
-  typedef int M; // { dg-error "protected" }
+  typedef int M; // { dg-message "protected" }
 };
 
 template <typename T>
Index: testsuite/g++.dg/template/using16.C
===================================================================
--- testsuite/g++.dg/template/using16.C	(revision 221871)
+++ testsuite/g++.dg/template/using16.C	(working copy)
@@ -11,7 +11,7 @@  struct B
 {
     class type
     {
-	type(); // { dg-error "private" }
+	type(); // { dg-message "private" }
     };
 };
 
Index: testsuite/g++.dg/template/virtual3.C
===================================================================
--- testsuite/g++.dg/template/virtual3.C	(revision 221871)
+++ testsuite/g++.dg/template/virtual3.C	(working copy)
@@ -2,7 +2,7 @@ 
 
 template<int> class A
 {
-  virtual ~A();			// { dg-error "non-deleted|private" }
+  virtual ~A();			// { dg-message "non-deleted|private" }
 };
 
 struct B : A<0>, A<1>		// { dg-error "deleted|context" }
Index: testsuite/g++.dg/ubsan/pr61272.C
===================================================================
--- testsuite/g++.dg/ubsan/pr61272.C	(revision 221871)
+++ testsuite/g++.dg/ubsan/pr61272.C	(working copy)
@@ -7,7 +7,7 @@  namespace std
   template < typename _Tp > class allocator;
   template < typename _Alloc > struct allocator_traits {
   private:
-      template < typename _Tp > auto construct ( _Alloc & __a, _Tp * __p)-> // { dg-error "is private" }
+      template < typename _Tp > auto construct ( _Alloc & __a, _Tp * __p)-> // { dg-message "private" }
       decltype (_S_construct (__a, __p)) { }
   };
   namespace __gnu_cxx
Index: testsuite/g++.old-deja/g++.bob/inherit2.C
===================================================================
--- testsuite/g++.old-deja/g++.bob/inherit2.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.bob/inherit2.C	(working copy)
@@ -6,7 +6,7 @@  class A {
   void z();
   A(void) {}
 private:
-  A(const A &) { abort(); } // { dg-error "private" } 
+  A(const A &) { abort(); } // { dg-message "private" } 
   const A& operator =(const A &) { abort(); }
 };
 
Index: testsuite/g++.old-deja/g++.brendan/crash11.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/crash11.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/crash11.C	(working copy)
@@ -3,8 +3,8 @@ 
 extern "C" int printf (const char *, ...);
 
 class A {
-        int	i; // { dg-error "" } private
-        int	j; // { dg-error "" } private
+        int	i; // { dg-message "" } private
+        int	j; // { dg-message "" } private
     public:
 	int	h;
 	A() { i=10; j=20; }
Index: testsuite/g++.old-deja/g++.brendan/enum6.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/enum6.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/enum6.C	(working copy)
@@ -2,7 +2,7 @@ 
 // GROUPS passed enums
 class X {
   private:
-    enum E1 {a1, b1}; // { dg-error "" } private
+    enum E1 {a1, b1}; // { dg-message "" } private
   public:
     enum E2 {a2, b2};
     };
Index: testsuite/g++.old-deja/g++.brendan/visibility1.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility1.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/visibility1.C	(working copy)
@@ -2,7 +2,7 @@ 
 // GROUPS passed visibility
 class foo {
 protected:
-  int i; // { dg-error "" } protected
+  int i; // { dg-message "" } protected
 };
 
 class bar : public foo {
Index: testsuite/g++.old-deja/g++.brendan/visibility10.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility10.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/visibility10.C	(working copy)
@@ -3,7 +3,7 @@ 
 struct base
 {
     protected:
-        void base_func() {}// { dg-error "" } .*is protected.*
+        void base_func() {}// { dg-message "" } .*protected.*
 };
 
 struct derived : public base
Index: testsuite/g++.old-deja/g++.brendan/visibility2.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility2.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/visibility2.C	(working copy)
@@ -1,7 +1,7 @@ 
 // { dg-do assemble  }
 // GROUPS passed visibility
 class X {
-      void g (int); // { dg-error "" } private
+      void g (int); // { dg-message "" } private
 public:
   void g (double);
 };
Index: testsuite/g++.old-deja/g++.brendan/visibility6.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility6.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/visibility6.C	(working copy)
@@ -3,7 +3,7 @@ 
 class bottom
 {
 public:
-  int b; // { dg-error "" } private
+  int b; // { dg-message "" } private
 };
 class middle : private bottom
 {
Index: testsuite/g++.old-deja/g++.brendan/visibility7.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility7.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/visibility7.C	(working copy)
@@ -3,7 +3,7 @@ 
 class X
 {
 public:
-  void fn ();// { dg-error "" } .*
+  void fn ();// { dg-message "" } .*
 };
 class Y : private X
 {};
Index: testsuite/g++.old-deja/g++.brendan/visibility8.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility8.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/visibility8.C	(working copy)
@@ -5,7 +5,7 @@ 
 class foo
 {
 public:
-  static int y; // { dg-error "" } private
+  static int y; // { dg-message "" } private
 };
 class foo1 : private foo
 { };
Index: testsuite/g++.old-deja/g++.brendan/visibility9.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility9.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.brendan/visibility9.C	(working copy)
@@ -2,7 +2,7 @@ 
 // GROUPS passed visibility
 class A {
 public:
-        void aMethod(void) {};// { dg-error "" } .*
+        void aMethod(void) {};// { dg-message "" } .*
 };
 
 class AA : A { };
Index: testsuite/g++.old-deja/g++.bugs/900428_03.C
===================================================================
--- testsuite/g++.old-deja/g++.bugs/900428_03.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.bugs/900428_03.C	(working copy)
@@ -18,7 +18,7 @@  struct struct_0 {
 };
 
 struct_0::struct_0 (int i) { }
-struct_0::struct_0 (int, int) { } // { dg-error "is private" }
+struct_0::struct_0 (int, int) { } // { dg-message "private" }
 
 struct struct_1 : public struct_0 {
 
Index: testsuite/g++.old-deja/g++.jason/access17.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access17.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.jason/access17.C	(working copy)
@@ -3,8 +3,8 @@ 
 
 struct A {
 protected:
-  int i;                        // { dg-error "" } private
-  int f ();			// { dg-error "" } 
+  int i;                        // { dg-message "" } private
+  int f ();			// { dg-message "" } 
 };
 
 struct B: public A {
Index: testsuite/g++.old-deja/g++.jason/access18.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access18.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.jason/access18.C	(working copy)
@@ -6,8 +6,8 @@ 
 int r = 0;
 class A {
   private:
-    A() { r = 1; }		// { dg-error "" } 
-    ~A() {}			// { dg-error "" } 
+    A() { r = 1; }		// { dg-message "" } 
+    ~A() {}			// { dg-message "" } 
 };
     
 class B : public A {
Index: testsuite/g++.old-deja/g++.jason/access22.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access22.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.jason/access22.C	(working copy)
@@ -5,7 +5,7 @@ 
 class A
 {
   private:
-    static void foo() {}	// { dg-error "" } 
+    static void foo() {}	// { dg-message "" } 
   public:
     void goo() {}
 };
Index: testsuite/g++.old-deja/g++.jason/access23.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access23.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.jason/access23.C	(working copy)
@@ -17,24 +17,24 @@  struct Foo {
   int PUB_A;
 protected:
   union {
-    long B; // { dg-error "" } protected
-    void *pY; // { dg-error "" } protected
+    long B; // { dg-message "" } protected
+    void *pY; // { dg-message "" } protected
   } ;
   union Y {
     long B;
     void *pY;
-  } PRT; // { dg-error "" } protected
-  int PRT_A; // { dg-error "" } protected
+  } PRT; // { dg-message "" } protected
+  int PRT_A; // { dg-message "" } protected
 private:
   union {
-    long C; // { dg-error "" } private
-    void *pZ; // { dg-error "" } private
+    long C; // { dg-message "" } private
+    void *pZ; // { dg-message "" } private
   };
   union Z {
     long C;  
     void *pZ;
-  } PRV; // { dg-error "" } private
-  int PRV_A; // { dg-error "" } private
+  } PRV; // { dg-message "" } private
+  int PRV_A; // { dg-message "" } private
 };
 
 struct Bar : public Foo {
Index: testsuite/g++.old-deja/g++.jason/access8.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access8.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.jason/access8.C	(working copy)
@@ -3,7 +3,7 @@ 
 // Date: 25 Jan 1994 23:41:33 -0500
 // Bug: g++ forgets access decls after the definition.
 
-class inh { // { dg-error "" } inaccessible
+class inh { // { dg-message "" } inaccessible
         int a;
 protected:
         void myf(int);
Index: testsuite/g++.old-deja/g++.jason/delete3.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/delete3.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.jason/delete3.C	(working copy)
@@ -6,7 +6,7 @@  class A {
   A();
   ~A();
 protected:
-  void operator delete(void *);	// { dg-error "" } protected
+  void operator delete(void *);	// { dg-message "" } protected
 };
 
 A::~A()
Index: testsuite/g++.old-deja/g++.jason/report.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/report.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.jason/report.C	(working copy)
@@ -42,7 +42,7 @@  int foo2 (int (*a)(int) = &foo)
 }
 
 class X{
-  class Y{};			// { dg-error "" } private
+  class Y{};			// { dg-message "" } private
 };
 
 typedef int const * bart ();
Index: testsuite/g++.old-deja/g++.law/access2.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access2.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/access2.C	(working copy)
@@ -10,7 +10,7 @@  template <class T> class Foo
 {
 private:
     friend class Bar; // To avoid warning.
-      Foo(const T &v) {}; // { dg-error "" } private
+      Foo(const T &v) {}; // { dg-message "" } private
 };
 
 
Index: testsuite/g++.old-deja/g++.law/access3.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access3.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/access3.C	(working copy)
@@ -7,7 +7,7 @@ 
 // Subject: bug with access control to member functions
 
        class X {
-	     void g (int); // { dg-error "" } is private
+	     void g (int); // { dg-message "" } is private
         public:
           void g (double);
         };
Index: testsuite/g++.old-deja/g++.law/access4.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access4.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/access4.C	(working copy)
@@ -6,9 +6,9 @@ 
 // Subject:  g++ 2.5.5 doesn't warn about inaccessible virtual base ctor
 // Message-ID: <9403030024.AA04534@ses.com>
 
-class ForceLeafSterile { // { dg-error "" } 
+class ForceLeafSterile { // { dg-message "" } 
     friend class Sterile;
-      ForceLeafSterile() {} // { dg-error "" } 
+      ForceLeafSterile() {} // { dg-message "" } 
 };
 
 class Sterile : private virtual ForceLeafSterile {
Index: testsuite/g++.old-deja/g++.law/access5.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access5.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/access5.C	(working copy)
@@ -13,7 +13,7 @@  class enclose {
 protected:
   class nested_protected { int x; };
 private:
-  class nested_private { int x; }; // { dg-error "" } private
+  class nested_private { int x; }; // { dg-message "" } private
 };
 
 class derived : public enclose {
Index: testsuite/g++.old-deja/g++.law/arm12.C
===================================================================
--- testsuite/g++.old-deja/g++.law/arm12.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/arm12.C	(working copy)
@@ -22,7 +22,7 @@  class Y : public X
   Y();
 };
 
-X::X() // { dg-error "is private" }
+X::X() // { dg-message "private" }
 {
   std::cout << "X::X()" << std::endl;
 }
Index: testsuite/g++.old-deja/g++.law/arm14.C
===================================================================
--- testsuite/g++.old-deja/g++.law/arm14.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/arm14.C	(working copy)
@@ -9,7 +9,7 @@ 
 
 class X {
   private:
-    enum E1 {a1, b1}; // { dg-error "" } private
+    enum E1 {a1, b1}; // { dg-message "" } private
   public:
     enum E2 {a2, b2};
     };
Index: testsuite/g++.old-deja/g++.law/ctors13.C
===================================================================
--- testsuite/g++.old-deja/g++.law/ctors13.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/ctors13.C	(working copy)
@@ -3,7 +3,7 @@ 
 #include <iostream>
 
 class A {
-   A() {}    // private constructor// { dg-error "" } .*
+   A() {}    // private constructor// { dg-message "" } .*
 };
 
 int main() {
Index: testsuite/g++.old-deja/g++.law/union2.C
===================================================================
--- testsuite/g++.old-deja/g++.law/union2.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/union2.C	(working copy)
@@ -10,9 +10,9 @@  class A {
 public:
   int x;
 private:
-  int y;    // { dg-error "" } private
+  int y;    // { dg-message "" } private
   union {
-    int z;  // { dg-error "" } private
+    int z;  // { dg-message "" } private
   };
 };
 
Index: testsuite/g++.old-deja/g++.law/visibility12.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility12.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility12.C	(working copy)
@@ -6,7 +6,7 @@ 
 // Subject:  member access rule bug
 // Message-ID: <9306300528.AA17185@coda.mel.dit.CSIRO.AU>
 struct a {
-  int aa; // { dg-error "" } private
+  int aa; // { dg-message "" } private
         };
 
 class b : private a {
Index: testsuite/g++.old-deja/g++.law/visibility15.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility15.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility15.C	(working copy)
@@ -10,7 +10,7 @@ 
 
 class X {
 private:
-  void* operator new(size_t) throw(){// { dg-error "" } .*
+  void* operator new(size_t) throw(){// { dg-message "" } .*
     printf("Inside private new().\n");
     return NULL;
   }
Index: testsuite/g++.old-deja/g++.law/visibility16.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility16.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility16.C	(working copy)
@@ -7,7 +7,7 @@ 
 // Message-ID: <9308051553.AA07639@nwd2sun1.analog.com>
 class A {
   protected:
-    int astuff; // { dg-error "" } protected
+    int astuff; // { dg-message "" } protected
     A() {
         astuff = 3; 
     }
Index: testsuite/g++.old-deja/g++.law/visibility17.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility17.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility17.C	(working copy)
@@ -31,12 +31,12 @@  class Derived : public Base
   int num_;
 };
 
-Base::Base() // { dg-error "is private" }
+Base::Base() // { dg-message "private" }
 {
   name_ = std::strcpy(new char[std::strlen(" ") + 1], " ");
 }
 
-Base::Base(char* str) // { dg-error "is private" }
+Base::Base(char* str) // { dg-message "private" }
 {
   if(str != NULL)
     name_ = std::strcpy(new char[std::strlen(str) + 1], str);
Index: testsuite/g++.old-deja/g++.law/visibility18.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility18.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility18.C	(working copy)
@@ -7,7 +7,7 @@ 
 // Message-ID: <9308061142.AA08533@iiserv>
 struct T1 { int i; };
 
-struct T2 { int j; }; // { dg-error "" } private
+struct T2 { int j; }; // { dg-message "" } private
 
 struct T3 : public T1, private T2 {
 } x;
Index: testsuite/g++.old-deja/g++.law/visibility19.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility19.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility19.C	(working copy)
@@ -7,7 +7,7 @@ 
 // Message-ID: <9308252030.AA02352@tnt.acsys.com>
 class B {
 protected:
-    int i; // { dg-error "" } protected
+    int i; // { dg-message "" } protected
 };
 
 class D1 : public B {
Index: testsuite/g++.old-deja/g++.law/visibility20.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility20.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility20.C	(working copy)
@@ -8,7 +8,7 @@ 
 
 class Base {
 protected:
-      void protectedBaseFunction() {} // { dg-error "" } protected
+      void protectedBaseFunction() {} // { dg-message "" } protected
 public:
     Base() {}
 };
Index: testsuite/g++.old-deja/g++.law/visibility21.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility21.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility21.C	(working copy)
@@ -7,7 +7,7 @@ 
 // Message-ID: <9308121003.AA02294@mi.el.utwente.nl>
 class A {
 protected:
-      void foo(); // { dg-error "" } protected
+      void foo(); // { dg-message "" } protected
 };
 
 class B : public A
Index: testsuite/g++.old-deja/g++.law/visibility24.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility24.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility24.C	(working copy)
@@ -14,7 +14,7 @@  template <class T>
 class A
 {
 public:
-      void Fun() { printf( "Fun fun fun!\n" ); } // { dg-error "" } private
+      void Fun() { printf( "Fun fun fun!\n" ); } // { dg-message "" } private
 };
 
 
Index: testsuite/g++.old-deja/g++.law/visibility4.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility4.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility4.C	(working copy)
@@ -8,7 +8,7 @@ 
 
 class A {
 public:
-     int b; // { dg-error "" } private
+     int b; // { dg-message "" } private
 };
 
 class C : private A {                   // NOTE WELL. private, not public
Index: testsuite/g++.old-deja/g++.law/visibility5.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility5.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility5.C	(working copy)
@@ -4,7 +4,7 @@ 
 class a {
 
 private:
-  a (int i);// { dg-error "" } .*
+  a (int i);// { dg-message "" } .*
 
 public:
   a ();
Index: testsuite/g++.old-deja/g++.law/visibility6.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility6.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility6.C	(working copy)
@@ -8,7 +8,7 @@ 
 class Top {
 public:
     Top() {}
-      void val() {} // { dg-error "" } private base class
+      void val() {} // { dg-message "" } private base class
 };
 
 class Derived : private Top {
Index: testsuite/g++.old-deja/g++.law/visibility7.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility7.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility7.C	(working copy)
@@ -15,9 +15,9 @@  class A {
     {}
   virtual ~A()
     {}
-  virtual void Number(int c) // { dg-error "inaccessible" }
+  virtual void Number(int c) // { dg-message "declared" }
     { number = c; }
-  virtual int Number() // { dg-error "inaccessible" }
+  virtual int Number() // { dg-message "declared" }
     { return number; }
 };
 
Index: testsuite/g++.old-deja/g++.law/visibility8.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility8.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility8.C	(working copy)
@@ -7,7 +7,7 @@ 
 // Message-ID: <m0nof3E-0021ifC@jts.com
 class t1 {
 protected:
-    int a; // { dg-error "" } protected
+    int a; // { dg-message "" } protected
 };
 
 
Index: testsuite/g++.old-deja/g++.law/visibility9.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility9.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.law/visibility9.C	(working copy)
@@ -8,7 +8,7 @@ 
 
 class A {
 protected:
-    int a; // { dg-error "" } protected
+    int a; // { dg-message "" } protected
 };
 
 class B : public A {
Index: testsuite/g++.old-deja/g++.niklas/t135.C
===================================================================
--- testsuite/g++.old-deja/g++.niklas/t135.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.niklas/t135.C	(working copy)
@@ -8,7 +8,7 @@  template <class T> class C1
 
 class C2
 {
-	int data_member; // { dg-error "" }
+	int data_member; // { dg-message "" }
   friend class C1; // { dg-error "" }
 };
 
Index: testsuite/g++.old-deja/g++.oliva/delete1.C
===================================================================
--- testsuite/g++.old-deja/g++.oliva/delete1.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.oliva/delete1.C	(working copy)
@@ -13,7 +13,7 @@ 
 struct foo {
   foo() {}
 private:
-  void operator delete(void *) {} // { dg-error "" } private
+  void operator delete(void *) {} // { dg-message "" } private
 } foo_;
 
 struct bar : foo {
Index: testsuite/g++.old-deja/g++.oliva/partord1.C
===================================================================
--- testsuite/g++.old-deja/g++.oliva/partord1.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.oliva/partord1.C	(working copy)
@@ -9,7 +9,7 @@  template <typename T> void foo(T*);
 
 template <typename T> class bar {
  private:
-  int i; // { dg-error "" } this variable
+  int i; // { dg-message "" } this variable
   friend void foo<T>(T);
 };
 
Index: testsuite/g++.old-deja/g++.other/access11.C
===================================================================
--- testsuite/g++.old-deja/g++.other/access11.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/access11.C	(working copy)
@@ -10,7 +10,7 @@  class A
 };
 
 template <>
-void A::g<int>(int t) { i = 1; } // { dg-error "" } private
+void A::g<int>(int t) { i = 1; } // { dg-message "" } private
 
 int main()
 {
Index: testsuite/g++.old-deja/g++.other/access4.C
===================================================================
--- testsuite/g++.old-deja/g++.other/access4.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/access4.C	(working copy)
@@ -1,6 +1,6 @@ 
 // { dg-do assemble  }
 
-struct A { // { dg-error "" } inaccessible
+struct A { // { dg-message "" } inaccessible
   static int i;
 };
 
Index: testsuite/g++.old-deja/g++.other/access7.C
===================================================================
--- testsuite/g++.old-deja/g++.other/access7.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/access7.C	(working copy)
@@ -4,8 +4,8 @@ 
 
 
 class A {
-  static int I1;		// { dg-error "" } private
-  struct B1 { };		// { dg-error "" } private
+  static int I1;		// { dg-message "" } private
+  struct B1 { };		// { dg-message "" } private
 public:
   static int I2;
   struct B2 { };
Index: testsuite/g++.old-deja/g++.other/crash1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/crash1.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/crash1.C	(working copy)
@@ -1,7 +1,7 @@ 
 // { dg-do assemble  }
 class A
 {
-  enum B { ONE, TWO, THREE }; // { dg-error "" } private
+  enum B { ONE, TWO, THREE }; // { dg-message "" } private
 };
 
 class A::B; // { dg-error "" } A::B is not a class type, context
Index: testsuite/g++.old-deja/g++.other/crash7.C
===================================================================
--- testsuite/g++.old-deja/g++.other/crash7.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/crash7.C	(working copy)
@@ -4,7 +4,7 @@  void f()
 {
   union {
   private:
-    int i; // { dg-error "" } private
+    int i; // { dg-message "" } private
   } u;
 
   u.i = 3; // { dg-error "" } within this context
Index: testsuite/g++.old-deja/g++.other/friend1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/friend1.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/friend1.C	(working copy)
@@ -22,7 +22,7 @@  struct R;
 
 class B {
 protected:
-  int i; // { dg-error "" } in this context
+  int i; // { dg-message "" } protected
   static int j;
 };
 
@@ -51,7 +51,7 @@  D d;
 
 void f()
 {
-    b.i = 3; // { dg-error "" } protected
+    b.i = 3; // { dg-error "" } in this context
     d.i = 4;
     B::j = 5;
     D::j = 6;
@@ -60,7 +60,7 @@  void f()
 template <typename T>
 void g()
 {
-    b.i = 3; // { dg-error "" } protected
+    b.i = 3; // { dg-error "" } in this context
     d.i = 4;
     B::j = 5;
     D::j = 6;
@@ -70,7 +70,7 @@  template void g<int>();
 
 void S::h()
 {
-  b.i = 3; // { dg-error "" } protected
+  b.i = 3; // { dg-error "" } in this context
   d.i = 4;
   B::j = 5;
   D::j = 6;
@@ -79,7 +79,7 @@  void S::h()
 template <typename T>
 void R<T>::h() 
 {
-  b.i = 3; // { dg-error "" } protected
+  b.i = 3; // { dg-error "" } in this context
   d.i = 4;
   B::j = 5;
   D::j = 6;
Index: testsuite/g++.old-deja/g++.other/friend4.C
===================================================================
--- testsuite/g++.old-deja/g++.other/friend4.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/friend4.C	(working copy)
@@ -10,7 +10,7 @@ 
 
 template <class A, class B> void foo();
 template <class C> class bar {
-  int i; // { dg-error "" } private
+  int i; // { dg-message "" } private
   template <class B> friend void foo<C,B>(); // { dg-error "" } bogus declaration
 };
 template <class A, class B> void foo() {
Index: testsuite/g++.old-deja/g++.other/friend9.C
===================================================================
--- testsuite/g++.old-deja/g++.other/friend9.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/friend9.C	(working copy)
@@ -7,7 +7,7 @@ 
 
 class F
 {
-  class Internal;   // { dg-error "" } is private
+  class Internal;   // { dg-message "" } private
 };
 
 class C
Index: testsuite/g++.old-deja/g++.other/lineno1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/lineno1.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/lineno1.C	(working copy)
@@ -5,8 +5,8 @@ 
 
 class A
 {
-  A();				// { dg-error "" } private
-  ~A();				// { dg-error "" } private
+  A();				// { dg-message "" } private
+  ~A();				// { dg-message "" } private
 };
 
 static A a;			// { dg-error "" } here
Index: testsuite/g++.old-deja/g++.other/using1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/using1.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.other/using1.C	(working copy)
@@ -3,7 +3,7 @@  class D2;
 
 class B {
 private:
-  int a; // { dg-error "" } B::a is private
+  int a; // { dg-message "" } B::a declared private
 protected:
   int b;
 
Index: testsuite/g++.old-deja/g++.pt/enum14.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/enum14.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.pt/enum14.C	(working copy)
@@ -24,8 +24,8 @@  template <class>
 struct B
 {
   private:
-  enum foo {bar}; // { dg-error "" } private
-  typedef int baz;  // { dg-error "" } private
+  enum foo {bar}; // { dg-message "" } private
+  typedef int baz;  // { dg-message "" } private
 };
 
 struct D: public B<int>
Index: testsuite/g++.old-deja/g++.pt/friend11.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/friend11.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.pt/friend11.C	(working copy)
@@ -21,7 +21,7 @@  class C
   template <class U>
   friend void S<T>::f(U);
 
-  int i; // { dg-error "" } private
+  int i; // { dg-message "" } private
 };
 
 
Index: testsuite/g++.old-deja/g++.pt/friend21.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/friend21.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.pt/friend21.C	(working copy)
@@ -7,7 +7,7 @@  template <class T> struct A {
 template <class T> class B
 {
   friend class A<T>;
-  static int i; // { dg-error "" } private
+  static int i; // { dg-message "" } private
 };
 
 template <class T> class C
Index: testsuite/g++.old-deja/g++.pt/friend3.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/friend3.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.pt/friend3.C	(working copy)
@@ -7,7 +7,7 @@  class C
 {
   friend void f<>(double);
 
-  int i; // { dg-error "" } private
+  int i; // { dg-message "" } private
 };
 
 
Index: testsuite/g++.old-deja/g++.pt/inherit2.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/inherit2.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.pt/inherit2.C	(working copy)
@@ -24,7 +24,7 @@  template <class T> class B
   static T value_AC;
 };
 template <typename T> T B<T>::valueA_AA;
-template <typename T> T B<T>::valueA_AC;// { dg-error "" "" } private - 
+template <typename T> T B<T>::valueA_AC;// { dg-message "" "" } private - 
 template <typename T> T B<T>::value_AC;	// { dg-bogus "" "" }  - 
 
 // this one is a friend
Index: testsuite/g++.old-deja/g++.pt/memtemp74.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/memtemp74.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.pt/memtemp74.C	(working copy)
@@ -5,11 +5,11 @@  class S
 {
 protected:
   template <class U>
-  void f(U); // { dg-error "" } is protected
+  void f(U); // { dg-message "" } protected
 
 private:
   template <class U>
-  void g(U); // { dg-error "" } is private
+  void g(U); // { dg-message "" } private
 };
 
 
Index: testsuite/g++.old-deja/g++.pt/memtemp89.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/memtemp89.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.pt/memtemp89.C	(working copy)
@@ -5,7 +5,7 @@ 
 
 class Q {
 	template<class T>
-	class X {		// { dg-error "" } Q::X private
+	class X {		// { dg-message "" } Q::X private
 	};
 };
 template<template<class> class XX>
Index: testsuite/g++.old-deja/g++.robertl/eb94.C
===================================================================
--- testsuite/g++.old-deja/g++.robertl/eb94.C	(revision 221871)
+++ testsuite/g++.old-deja/g++.robertl/eb94.C	(working copy)
@@ -10,7 +10,7 @@  static int variable;
 class myClass : public baseClass
 {
 private:
-static int variable;                    // { dg-error "private" }
+static int variable;                    // { dg-message "private" }
 };
 
 myClass::variable = 0;                  //{ dg-error "" } no type