diff mbox

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

Message ID 551FE078.2020904@oracle.com
State New
Headers show

Commit Message

Paolo Carlini April 4, 2015, 1 p.m. UTC
Hi,

I noticed a while ago that for each access control issue we emit two 
errors instead of an error + an inform, as we lately try to consistently 
do. I also noticed that the testsuite reflects that in many testcases... 
Anyway, the below - for next Stage 1? - implements the change, passes 
testing on x86_64-linux.

Thanks,
Paolo.

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

Comments

Jason Merrill April 6, 2015, 2:07 p.m. UTC | #1
On 04/04/2015 09:00 AM, Paolo Carlini wrote:
>  	    error ("%q+#D is inaccessible", diag_decl);
> -	  error ("within this context");
> +	  inform (input_location, "within this context");

This is the wrong error to change to inform; we want the error to be 
associated with the point of use, not the declaration of the member.

Jason
Paolo Carlini April 7, 2015, 9:35 a.m. UTC | #2
Hi,

On 04/06/2015 04:07 PM, Jason Merrill wrote:
> On 04/04/2015 09:00 AM, Paolo Carlini wrote:
>>          error ("%q+#D is inaccessible", diag_decl);
>> -      error ("within this context");
>> +      inform (input_location, "within this context");
>
> This is the wrong error to change to inform; we want the error to be 
> associated with the point of use, not the declaration of the member.
Yeah, I see what you mean. That requires a rewording however, let me see...

Paolo.
diff mbox

Patch

Index: cp/call.c
===================================================================
--- cp/call.c	(revision 221865)
+++ cp/call.c	(working copy)
@@ -6025,7 +6025,7 @@  enforce_access (tree basetype_path, tree decl, tre
 	    error ("%q+#D is protected", diag_decl);
 	  else
 	    error ("%q+#D is inaccessible", diag_decl);
-	  error ("within this context");
+	  inform (input_location, "within this context");
 	}
       return false;
     }
Index: testsuite/g++.dg/cpp0x/alias-decl-22.C
===================================================================
--- testsuite/g++.dg/cpp0x/alias-decl-22.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/alias-decl-22.C	(working copy)
@@ -3,7 +3,7 @@ 
 // { dg-do compile { target c++11 } }
 
 template <class T>
-using foo = typename T::bar;	// { dg-error "this context" }
+using foo = typename T::bar;	// { dg-message "this context" }
 
 class B
 {
Index: testsuite/g++.dg/cpp0x/decltype-call1.C
===================================================================
--- testsuite/g++.dg/cpp0x/decltype-call1.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/decltype-call1.C	(working copy)
@@ -27,6 +27,6 @@  B h();
 void i(const B&);
 
 decltype(h()) g5a();		// OK
-decltype(h().i) g5();		// { dg-error "" }
-decltype(h()[0]) g6();		// { dg-error "" }
-decltype(i(h())) g7();		// { dg-error "" }
+decltype(h().i) g5();		// { dg-message "" }
+decltype(h()[0]) g6();		// { dg-message "" }
+decltype(i(h())) g7();		// { dg-message "" }
Index: testsuite/g++.dg/cpp0x/defaulted28.C
===================================================================
--- testsuite/g++.dg/cpp0x/defaulted28.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/defaulted28.C	(working copy)
@@ -12,6 +12,6 @@  struct A {
 int f(...) { }
 int main() {
   A a;
-  f(a); 			// { dg-error "this context" }
+  f(a); 			// { dg-message "this context" }
   sizeof(f(a));			// OK because unevaluated
 }
Index: testsuite/g++.dg/cpp0x/defaulted47.C
===================================================================
--- testsuite/g++.dg/cpp0x/defaulted47.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/defaulted47.C	(working copy)
@@ -6,7 +6,7 @@  class A
   A() = default;   // { dg-error "private" }
 };
 
-A a;               // { dg-error "context" }
+A a;               // { dg-message "context" }
 
 class B
 {
@@ -13,4 +13,4 @@  class B
   ~B() = default;  // { dg-error "private" }
 };
 
-B b;               // { dg-error "context" }
+B b;               // { dg-message "context" }
Index: testsuite/g++.dg/cpp0x/elision_neg.C
===================================================================
--- testsuite/g++.dg/cpp0x/elision_neg.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/elision_neg.C	(working copy)
@@ -24,13 +24,13 @@  move_only
 test1()
 {
     static move_only x;
-    return x;  //  { dg-error "within this context" }
+    return x;  //  { dg-message "within this context" }
 }
 
 move_only
 test2(move_only&& x)
 {
-    return x;  //  { dg-error "within this context" }
+    return x;  //  { dg-message "within this context" }
 }
 
 int main()
Index: testsuite/g++.dg/cpp0x/fntmpdefarg3.C
===================================================================
--- testsuite/g++.dg/cpp0x/fntmpdefarg3.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/fntmpdefarg3.C	(working copy)
@@ -4,7 +4,7 @@  template <class T, class = typename T::I> void f(T
 template <class T, class = typename T::I> void g(T) {}
 template <class T, class = typename T::I> void h(T) {}
 template <class T, class = typename T::I> void i(T) {}
-template <class T, class = typename T::I> void j(T) {} // { dg-error "this context" }
+template <class T, class = typename T::I> void j(T) {} // { dg-message "this context" }
 
 class A
 {
Index: testsuite/g++.dg/cpp0x/inh-ctor9.C
===================================================================
--- testsuite/g++.dg/cpp0x/inh-ctor9.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/inh-ctor9.C	(working copy)
@@ -12,4 +12,4 @@  struct B: A
   using A::A;			// { dg-error "protected" }
 };
 
-B b(42);			// { dg-error "this context" }
+B b(42);			// { dg-message "this context" }
Index: testsuite/g++.dg/cpp0x/range-for13.C
===================================================================
--- testsuite/g++.dg/cpp0x/range-for13.C	(revision 221865)
+++ testsuite/g++.dg/cpp0x/range-for13.C	(working copy)
@@ -91,12 +91,12 @@  void test1()
 {
   for (int x : container1()); // { dg-error "member but not" }
   for (int x : container2()); // { dg-error "member but not" }
-  for (int x : container3()); // { dg-error "within this context" }
+  for (int x : container3()); // { dg-message "within this context" }
   for (int x : container4()); // { dg-error "cannot be used as a function" }
   for (int x : container5()); // { dg-error "invalid use of" }
   for (int x : container6());
   for (int x : container7());
   for (int x : container8());
-  for (int x : container9()); // { dg-error "within this context" }
+  for (int x : container9()); // { dg-message "within this context" }
   for (int x : container10());
 }
Index: testsuite/g++.dg/gomp/clause-2.C
===================================================================
--- testsuite/g++.dg/gomp/clause-2.C	(revision 221865)
+++ testsuite/g++.dg/gomp/clause-2.C	(working copy)
@@ -19,19 +19,19 @@  void foo()
 
   #pragma omp parallel private(a, b, c, d, f, g)
     bar();
-  #pragma omp parallel private(e)		// { dg-error "context" }
+  #pragma omp parallel private(e)		// { dg-message "context" }
     bar();
 
   #pragma omp parallel firstprivate(a, b, c, d, e, g)
     bar();
-  #pragma omp parallel firstprivate(f)		// { dg-error "context" }
+  #pragma omp parallel firstprivate(f)		// { dg-message "context" }
     bar();
 
   #pragma omp parallel sections lastprivate(a, b, d, c, f)
     { bar(); }
-  #pragma omp parallel sections lastprivate(e)	// { dg-error "context" }
+  #pragma omp parallel sections lastprivate(e)	// { dg-message "context" }
     { bar(); }
-  #pragma omp parallel sections lastprivate(g)	// { dg-error "context" }
+  #pragma omp parallel sections lastprivate(g)	// { dg-message "context" }
     { bar(); }
   #pragma omp parallel sections firstprivate(e) lastprivate(e)
     { bar(); }
Index: testsuite/g++.dg/gomp/udr-5.C
===================================================================
--- testsuite/g++.dg/gomp/udr-5.C	(revision 221865)
+++ testsuite/g++.dg/gomp/udr-5.C	(working copy)
@@ -15,13 +15,13 @@  struct T : public S
   void foo ()
   {
     S s;
-    #pragma omp parallel reduction (S::operator +:s)	// { dg-error "within this context" }
+    #pragma omp parallel reduction (S::operator +:s)	// { dg-message "within this context" }
     s.s = 1;
     S t;
     #pragma omp parallel reduction (S::operator -:t)
     t.s = 1;
     S u;
-    #pragma omp parallel reduction (+:u)		// { dg-error "within this context" }
+    #pragma omp parallel reduction (+:u)		// { dg-message "within this context" }
     u.s = 1;
     S v;
     #pragma omp parallel reduction (-:v)
@@ -33,9 +33,9 @@  void
 foo ()
 {
   S s;
-  #pragma omp parallel reduction (S::operator +:s)	// { dg-error "within this context" }
+  #pragma omp parallel reduction (S::operator +:s)	// { dg-message "within this context" }
   s.s = 1;
   S t;
-  #pragma omp parallel reduction (S::operator -:t)	// { dg-error "within this context" }
+  #pragma omp parallel reduction (S::operator -:t)	// { dg-message "within this context" }
   t.s = 1;
 }
Index: testsuite/g++.dg/inherit/access6.C
===================================================================
--- testsuite/g++.dg/inherit/access6.C	(revision 221865)
+++ testsuite/g++.dg/inherit/access6.C	(working copy)
@@ -10,6 +10,6 @@  void h()
 {
   Foo foo;
   void (*f)();
-  f = foo.f; // { dg-error "context" }
-  f = foo.g; // { dg-error "context" }
+  f = foo.f; // { dg-message "context" }
+  f = foo.g; // { dg-message "context" }
 }
Index: testsuite/g++.dg/lookup/duperr1.C
===================================================================
--- testsuite/g++.dg/lookup/duperr1.C	(revision 221865)
+++ testsuite/g++.dg/lookup/duperr1.C	(working copy)
@@ -2,4 +2,4 @@ 
 
 class A { int i; }; // { dg-bogus "is private.*is private" }
 // { dg-error "is private" "" { target *-*-* } 3 }
-class B:public A { B() { A::i=0; } }; // { dg-error "within this context" }
+class B:public A { B() { A::i=0; } }; // { dg-message "within this context" }
Index: testsuite/g++.dg/lookup/friend2.C
===================================================================
--- testsuite/g++.dg/lookup/friend2.C	(revision 221865)
+++ testsuite/g++.dg/lookup/friend2.C	(working copy)
@@ -17,5 +17,5 @@  namespace NS {
 }
 
 void S::test () {
-  NS::X::i;		// { dg-error "this context" }
+  NS::X::i;		// { dg-message "this context" }
 }
Index: testsuite/g++.dg/lookup/pr6936.C
===================================================================
--- testsuite/g++.dg/lookup/pr6936.C	(revision 221865)
+++ testsuite/g++.dg/lookup/pr6936.C	(working copy)
@@ -20,4 +20,4 @@  struct Derv : Base
 };
 
 int k = Derv::j;
-int l = Derv::i; // { dg-error "context" }
+int l = Derv::i; // { dg-message "context" }
Index: testsuite/g++.dg/lookup/using26.C
===================================================================
--- testsuite/g++.dg/lookup/using26.C	(revision 221865)
+++ testsuite/g++.dg/lookup/using26.C	(working copy)
@@ -17,7 +17,7 @@  struct C
     int next;
 };
 
-struct D : A, B, C // { dg-error "context" }
+struct D : A, B, C // { dg-message "context" }
 {
     using B::next;
     void f()
Index: testsuite/g++.dg/lookup/using38.C
===================================================================
--- testsuite/g++.dg/lookup/using38.C	(revision 221865)
+++ testsuite/g++.dg/lookup/using38.C	(working copy)
@@ -20,4 +20,4 @@  struct Derv : Base
 };
 
 int k = Derv::j;
-int l = Derv::i; // { dg-error "context" }
+int l = Derv::i; // { dg-message "context" }
Index: testsuite/g++.dg/other/access2.C
===================================================================
--- testsuite/g++.dg/other/access2.C	(revision 221865)
+++ testsuite/g++.dg/other/access2.C	(working copy)
@@ -23,7 +23,7 @@  int Base::fooprotected=42;
 int Base::foopublic=42;
 
 void Derived::test() {
-  if ( fooprivate );		// { dg-error "context" }
+  if ( fooprivate );		// { dg-message "context" }
   if ( fooprotected );
   if ( foopublic );
 }
Index: testsuite/g++.dg/overload/defarg3.C
===================================================================
--- testsuite/g++.dg/overload/defarg3.C	(revision 221865)
+++ testsuite/g++.dg/overload/defarg3.C	(working copy)
@@ -11,5 +11,5 @@  class D {
 public:
   /* C::f is inaccessible, so this is an error, even if this function
      is never called.  */
-  static void g(int (*)(int) = C::f); // { dg-error "context" }
+  static void g(int (*)(int) = C::f); // { dg-message "context" }
 };
Index: testsuite/g++.dg/overload/defarg6.C
===================================================================
--- testsuite/g++.dg/overload/defarg6.C	(revision 221865)
+++ testsuite/g++.dg/overload/defarg6.C	(working copy)
@@ -4,4 +4,4 @@  class A
   A(int i): i(i) {}		// { dg-error "private" }
 };
 
-void f (A = 1) { }		// { dg-error "context" }
+void f (A = 1) { }		// { dg-message "context" }
Index: testsuite/g++.dg/parse/access11.C
===================================================================
--- testsuite/g++.dg/parse/access11.C	(revision 221865)
+++ testsuite/g++.dg/parse/access11.C	(working copy)
@@ -26,10 +26,10 @@  class A {
   };
 };
 
-int a1 = A().i;  // { dg-error "context" }
-int a2 = A().j;  // { dg-error "context" }
-int a3 = A().k;  // { dg-error "context" }
-int a4 = A().l;  // { dg-error "context" }
-int a5 = A().m;  // { dg-error "context" }
-int a6 = A().n;  // { dg-error "context" }
-int a7 = A().o;  // { dg-error "context" }
+int a1 = A().i;  // { dg-message "context" }
+int a2 = A().j;  // { dg-message "context" }
+int a3 = A().k;  // { dg-message "context" }
+int a4 = A().l;  // { dg-message "context" }
+int a5 = A().m;  // { dg-message "context" }
+int a6 = A().n;  // { dg-message "context" }
+int a7 = A().o;  // { dg-message "context" }
Index: testsuite/g++.dg/parse/access2.C
===================================================================
--- testsuite/g++.dg/parse/access2.C	(revision 221865)
+++ testsuite/g++.dg/parse/access2.C	(working copy)
@@ -10,6 +10,6 @@  class A {
 };
 
 A::X A::a;
-A::X A::b, x;		// { dg-error "this context" }
-A::X y, A::c;		// { dg-error "this context" }
-A::X z;			// { dg-error "this context" }
+A::X A::b, x;		// { dg-message "this context" }
+A::X y, A::c;		// { dg-message "this context" }
+A::X z;			// { dg-message "this context" }
Index: testsuite/g++.dg/parse/access3.C
===================================================================
--- testsuite/g++.dg/parse/access3.C	(revision 221865)
+++ testsuite/g++.dg/parse/access3.C	(working copy)
@@ -10,5 +10,5 @@  class A {
 };
 
 class B {
-  friend void A::f();	// { dg-error "context" }
+  friend void A::f();	// { dg-message "context" }
 };
Index: testsuite/g++.dg/parse/access4.C
===================================================================
--- testsuite/g++.dg/parse/access4.C	(revision 221865)
+++ testsuite/g++.dg/parse/access4.C	(working copy)
@@ -14,7 +14,7 @@  class A {
 class B : public A {
   void bar() {
     A a;
-    void (A::*pmf)() = &A::foo;	// { dg-error "this context" }
+    void (A::*pmf)() = &A::foo;	// { dg-message "this context" }
     (a.*pmf)();
   }
 };
Index: testsuite/g++.dg/parse/access5.C
===================================================================
--- testsuite/g++.dg/parse/access5.C	(revision 221865)
+++ testsuite/g++.dg/parse/access5.C	(working copy)
@@ -13,6 +13,6 @@  struct A
 struct B : A 
 {
   void foo() {
-    (void)&A::a;		// { dg-error "this context" }
+    (void)&A::a;		// { dg-message "this context" }
   }
 };
Index: testsuite/g++.dg/parse/access6.C
===================================================================
--- testsuite/g++.dg/parse/access6.C	(revision 221865)
+++ testsuite/g++.dg/parse/access6.C	(working copy)
@@ -20,5 +20,5 @@  class B : public A
 int main()
 {
   B b;
-  return b.foo();		// { dg-error "this context" }
+  return b.foo();		// { dg-message "this context" }
 }
Index: testsuite/g++.dg/parse/access8.C
===================================================================
--- testsuite/g++.dg/parse/access8.C	(revision 221865)
+++ testsuite/g++.dg/parse/access8.C	(working copy)
@@ -5,8 +5,8 @@  class foo
   typedef int memfun;  // { dg-error "private" }
 };
 
-template<foo::memfun> // { dg-error "context" }
+template<foo::memfun> // { dg-message "context" }
 struct fm_obj { };
 
-template <typename T = foo::memfun> // { dg-error "context" }
+template <typename T = foo::memfun> // { dg-message "context" }
 struct S {};
Index: testsuite/g++.dg/parse/access9.C
===================================================================
--- testsuite/g++.dg/parse/access9.C	(revision 221865)
+++ testsuite/g++.dg/parse/access9.C	(working copy)
@@ -2,4 +2,4 @@ 
 
 class Foo { public:  typedef int type1; };
 class Bar { private: typedef Foo type2; }; // { dg-error "private" } 
-void g(Bar::type2::type1) {} // { dg-error "context" }
+void g(Bar::type2::type1) {} // { dg-message "context" }
Index: testsuite/g++.dg/parse/crash40.C
===================================================================
--- testsuite/g++.dg/parse/crash40.C	(revision 221865)
+++ testsuite/g++.dg/parse/crash40.C	(working copy)
@@ -26,13 +26,13 @@  template<bool> struct S {
   S(unsigned int = BBB::foo()->AAA::get()); /* { dg-error "is not a base of" } */
 };
 template<bool> struct SS {
-  SS(unsigned int = BBB::foo()->get()); /* { dg-error "within this context" } */
+  SS(unsigned int = BBB::foo()->get()); /* { dg-message "within this context" } */
 };
 
 void bar()
 {
   B().C::foo<0>(); /* { dg-error "is not a member of" } */
-  BB().AA::foo<0>(); /* { dg-error "within this context" } */
+  BB().AA::foo<0>(); /* { dg-message "within this context" } */
 
   int i;
   i.C::foo<0>(); /* { dg-error "which is of non-class type" } */
Index: testsuite/g++.dg/tc1/dr142.C
===================================================================
--- testsuite/g++.dg/tc1/dr142.C	(revision 221865)
+++ testsuite/g++.dg/tc1/dr142.C	(working copy)
@@ -16,8 +16,8 @@  class DD: public D {
 };
 
 void DD::f() {
-  mi = 3;          // { dg-error "within this context" "" }
-  si = 3;          // { dg-error "within this context" "" }
+  mi = 3;          // { dg-message "within this context" "" }
+  si = 3;          // { dg-message "within this context" "" }
   ::B b;
   b.mi = 3;
   b.si = 3;
@@ -27,6 +27,6 @@  void DD::f() {
   bp2->mi = 3;
 
 
-  B b2;                   // { dg-error "within this context" "" }
-  B::si = 3;              // { dg-error "within this context" "" }
+  B b2;                   // { dg-message "within this context" "" }
+  B::si = 3;              // { dg-message "within this context" "" }
 }
Index: testsuite/g++.dg/tc1/dr166.C
===================================================================
--- testsuite/g++.dg/tc1/dr166.C	(revision 221865)
+++ testsuite/g++.dg/tc1/dr166.C	(working copy)
@@ -24,11 +24,11 @@  namespace N {
 
     template <class T> void f(T)  // will be instantiated as f<long>
     {
-      M::A::x = 0;    // { dg-error "within this context" }
+      M::A::x = 0;    // { dg-message "within this context" }
       M::B::x = 0;
     }
     template <> void f<int>(int)
-    { M::A::x = 0; }      // { dg-error "within this context" }
+    { M::A::x = 0; }      // { dg-message "within this context" }
     template <> void f<double>(double )
     { 
       M::B::x = 0; 
@@ -41,8 +41,8 @@  namespace N {
 
   template <class T> void f(T)  // will be instantiated as f<long>
   { 
-    M::A::x = 0;       // { dg-error "within this context" }
-    M::B::x = 0;       // { dg-error "within this context" }
+    M::A::x = 0;       // { dg-message "within this context" }
+    M::B::x = 0;       // { dg-message "within this context" }
   }
 
   template <> void f<int>(int )
@@ -49,12 +49,12 @@  namespace N {
   { 
     N::f<long>(0);        // { dg-message "required" }
     M::A::x = 0; 
-    M::B::x = 0;       // { dg-error "within this context" }
+    M::B::x = 0;       // { dg-message "within this context" }
   }
 
   template <> void f<char>(char )
-  { M::A::x = 0; }      // { dg-error "within this context" }
+  { M::A::x = 0; }      // { dg-message "within this context" }
 
   void g(void)
-  { M::C::x = 0; }      // { dg-error "within this context" }
+  { M::C::x = 0; }      // { dg-message "within this context" }
 }
Index: testsuite/g++.dg/template/access11.C
===================================================================
--- testsuite/g++.dg/template/access11.C	(revision 221865)
+++ testsuite/g++.dg/template/access11.C	(working copy)
@@ -14,11 +14,11 @@  class X {
 };
 
 template <> struct X::Y<int> {
-  A::X x;			// { dg-error "this context" }
+  A::X x;			// { dg-message "this context" }
 };
 
 template <typename T> struct X::Y {
-  typename T::X x;		// { dg-error "this context" }
+  typename T::X x;		// { dg-message "this context" }
 };
 
 template struct X::Y<A>;	// { dg-message "required from here" }
Index: testsuite/g++.dg/template/access18.C
===================================================================
--- testsuite/g++.dg/template/access18.C	(revision 221865)
+++ testsuite/g++.dg/template/access18.C	(working copy)
@@ -7,13 +7,13 @@  class X {
   struct c; // { dg-error "private" }
 };
 
-template <typename = X::a> // { dg-error "context" }
+template <typename = X::a> // { dg-message "context" }
 struct A;
 
-template <int = X::b> // { dg-error "context" }
+template <int = X::b> // { dg-message "context" }
 struct B;
 
-template <template <typename> class T = X::c> // { dg-error "context" }
+template <template <typename> class T = X::c> // { dg-message "context" }
 struct C;
   
   
Index: testsuite/g++.dg/template/access19.C
===================================================================
--- testsuite/g++.dg/template/access19.C	(revision 221865)
+++ testsuite/g++.dg/template/access19.C	(working copy)
@@ -20,5 +20,5 @@  int foo( int x, explicit_t< int > y )
 
 int main()
 {
-        return foo( 5, 'c' ); /* { dg-error "this context" } */
+        return foo( 5, 'c' ); /* { dg-message "this context" } */
 }
Index: testsuite/g++.dg/template/access2.C
===================================================================
--- testsuite/g++.dg/template/access2.C	(revision 221865)
+++ testsuite/g++.dg/template/access2.C	(working copy)
@@ -4,8 +4,8 @@ 
 // Enforcing access of typename type.
 
 template <class T> struct A {
-  typename T::X x;			// { dg-error "this context" }
-  int f() { return T::i; }		// { dg-error "this context" }
+  typename T::X x;			// { dg-message "this context" }
+  int f() { return T::i; }		// { dg-message "this context" }
 };
 
 class B {
Index: testsuite/g++.dg/template/access20.C
===================================================================
--- testsuite/g++.dg/template/access20.C	(revision 221865)
+++ testsuite/g++.dg/template/access20.C	(working copy)
@@ -13,6 +13,6 @@  template <typename T> struct D : B<T>
 int main()
 {
         D<int> d;
-        d.v = 0;		// { dg-error "context" }
+        d.v = 0;		// { dg-message "context" }
         return 0;
 }
Index: testsuite/g++.dg/template/access26.C
===================================================================
--- testsuite/g++.dg/template/access26.C	(revision 221865)
+++ testsuite/g++.dg/template/access26.C	(working copy)
@@ -3,4 +3,4 @@ 
 template < typename T >
 struct A { static int i; };
 class B { typedef int X; };	// { dg-error "private" }
-void f() { A<B::X>::i = 0; }	// { dg-error "this context" }
+void f() { A<B::X>::i = 0; }	// { dg-message "this context" }
Index: testsuite/g++.dg/template/access3.C
===================================================================
--- testsuite/g++.dg/template/access3.C	(revision 221865)
+++ testsuite/g++.dg/template/access3.C	(working copy)
@@ -4,7 +4,7 @@ 
 // Enforcing access of typename type.
 
 template <class T> struct A {
-  typename T::template X<int> x;	// { dg-error "this context" }
+  typename T::template X<int> x;	// { dg-message "this context" }
 };
 
 class B {
Index: testsuite/g++.dg/template/access7.C
===================================================================
--- testsuite/g++.dg/template/access7.C	(revision 221865)
+++ testsuite/g++.dg/template/access7.C	(working copy)
@@ -9,7 +9,7 @@  class S {
 };
 
 template <typename A>
-typename A::T* f (A) {			// { dg-error "this context" }
+typename A::T* f (A) {			// { dg-message "this context" }
   return 0;
 }
 
Index: testsuite/g++.dg/template/conv12.C
===================================================================
--- testsuite/g++.dg/template/conv12.C	(revision 221865)
+++ testsuite/g++.dg/template/conv12.C	(working copy)
@@ -21,5 +21,5 @@  struct C2
   operator bool() { return false; }
 } c2;
 
-int ic2 = c2;			// { dg-error "" }
-int ac2 = c2 + c2;		// { dg-error "" }
+int ic2 = c2;			// { dg-message "" }
+int ac2 = c2 + c2;		// { dg-message "" }
Index: testsuite/g++.dg/template/friend31.C
===================================================================
--- testsuite/g++.dg/template/friend31.C	(revision 221865)
+++ testsuite/g++.dg/template/friend31.C	(working copy)
@@ -15,7 +15,7 @@  class W
 
 template <typename T, typename U> struct F
 {
-  void Look(W& w) { w.x = 3; }          // { dg-error "within this context" }
+  void Look(W& w) { w.x = 3; }          // { dg-message "within this context" }
 };
 
 int main()
Index: testsuite/g++.dg/template/friend32.C
===================================================================
--- testsuite/g++.dg/template/friend32.C	(revision 221865)
+++ testsuite/g++.dg/template/friend32.C	(working copy)
@@ -12,7 +12,7 @@  template<class T> class A
 
 template<class T> class B
 {
-  friend void A<T>::f ();	// { dg-error "this context" }
+  friend void A<T>::f ();	// { dg-message "this context" }
 };
 
 int f ()
Index: testsuite/g++.dg/template/memfriend15.C
===================================================================
--- testsuite/g++.dg/template/memfriend15.C	(revision 221865)
+++ testsuite/g++.dg/template/memfriend15.C	(working copy)
@@ -24,7 +24,7 @@  class C {
 template<class T> void A<T>::B2::f()
 {
   C c;
-  c.i = 0;	// { dg-error "context" }
+  c.i = 0;	// { dg-message "context" }
 }
 
 int main()
Index: testsuite/g++.dg/template/memfriend16.C
===================================================================
--- testsuite/g++.dg/template/memfriend16.C	(revision 221865)
+++ testsuite/g++.dg/template/memfriend16.C	(working copy)
@@ -24,7 +24,7 @@  class C {
 template<class T> template <class U> void A<T>::B2<U>::f()
 {
   C c;
-  c.i = 0;	// { dg-error "context" }
+  c.i = 0;	// { dg-message "context" }
 }
 
 int main()
Index: testsuite/g++.dg/template/memfriend17.C
===================================================================
--- testsuite/g++.dg/template/memfriend17.C	(revision 221865)
+++ testsuite/g++.dg/template/memfriend17.C	(working copy)
@@ -39,7 +39,7 @@  void A<T>::B::func1(void)
 template <typename T>
 void A<T>::B::func2(void)
 {
-    (void)F1<T*>::foo;	// { dg-error "context" }
+    (void)F1<T*>::foo;	// { dg-message "context" }
     (void)F2<T*>::foo;
 }
 
Index: testsuite/g++.dg/template/memfriend7.C
===================================================================
--- testsuite/g++.dg/template/memfriend7.C	(revision 221865)
+++ testsuite/g++.dg/template/memfriend7.C	(working copy)
@@ -36,31 +36,31 @@  template <class T> struct A<T*> {
 template <class T> void A<T*>::f(int)
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <class T> template <class U> void A<T*>::g()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <class T> int A<T*>::h()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <class T> void A<T*>::i(char)
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <class T> template <int> void A<T*>::j()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <> struct A<char> {
@@ -74,43 +74,43 @@  template <> struct A<char> {
 void A<char>::f(int)
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <class U> void A<char>::g()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <> void A<char>::g<int>()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 int A<char>::h()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 void A<char>::i(char)
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <int> void A<char>::j()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 template <> void A<char>::j<0>()
 {
   C c;
-  c.ii = 0;				// { dg-error "context" }
+  c.ii = 0;				// { dg-message "context" }
 }
 
 int main()
Index: testsuite/g++.dg/template/pr32519.C
===================================================================
--- testsuite/g++.dg/template/pr32519.C	(revision 221865)
+++ testsuite/g++.dg/template/pr32519.C	(working copy)
@@ -11,6 +11,6 @@  struct D : public B
 {
   void g (B* b)
   {
-    b->f<int> (); // { dg-error "context" }
+    b->f<int> (); // { dg-message "context" }
   }
 };
Index: testsuite/g++.dg/template/qualttp21.C
===================================================================
--- testsuite/g++.dg/template/qualttp21.C	(revision 221865)
+++ testsuite/g++.dg/template/qualttp21.C	(working copy)
@@ -13,5 +13,5 @@  class foo {
 
 int main()
 {
-  foo<int> a; // { dg-error "context" }
+  foo<int> a; // { dg-message "context" }
 }
Index: testsuite/g++.dg/template/qualttp8.C
===================================================================
--- testsuite/g++.dg/template/qualttp8.C	(revision 221865)
+++ testsuite/g++.dg/template/qualttp8.C	(working copy)
@@ -6,7 +6,7 @@  template <template <class> class TT> class C {
 };
 
 template <class T> struct D {
-	C<T::template B> c; // { dg-error "context" }
+	C<T::template B> c; // { dg-message "context" }
 };
 
 struct E {
Index: testsuite/g++.dg/template/ttp10.C
===================================================================
--- testsuite/g++.dg/template/ttp10.C	(revision 221865)
+++ testsuite/g++.dg/template/ttp10.C	(working copy)
@@ -16,6 +16,6 @@  struct B {
 class E : protected B<Template> {}; 
  
 void bar() {
-  E::foo1 (0);				// { dg-error "context" }
-  E::foo2 (0);				// { dg-error "context" }
+  E::foo1 (0);				// { dg-message "context" }
+  E::foo2 (0);				// { dg-message "context" }
 }
Index: testsuite/g++.dg/template/typedef11.C
===================================================================
--- testsuite/g++.dg/template/typedef11.C	(revision 221865)
+++ testsuite/g++.dg/template/typedef11.C	(working copy)
@@ -18,8 +18,8 @@  template <int>
 int
 bar ()
 {
-  Beta<0>::Y i = 0;		// { dg-error "within this context" }
-  return Alpha::X ();		// { dg-error "within this context" }
+  Beta<0>::Y i = 0;		// { dg-message "within this context" }
+  return Alpha::X ();		// { dg-message "within this context" }
 }
 
 int i = bar<0> ();
Index: testsuite/g++.dg/template/typedef13.C
===================================================================
--- testsuite/g++.dg/template/typedef13.C	(revision 221865)
+++ testsuite/g++.dg/template/typedef13.C	(working copy)
@@ -9,7 +9,7 @@  class A
 
 template <class T> class B : public A
 {
-  mytype mem; // { dg-error "within this context"  }
+  mytype mem; // { dg-message "within this context"  }
 };
 
 B<int> b; // { dg-message "required from here" }
Index: testsuite/g++.dg/template/typedef19.C
===================================================================
--- testsuite/g++.dg/template/typedef19.C	(revision 221865)
+++ testsuite/g++.dg/template/typedef19.C	(working copy)
@@ -15,7 +15,7 @@  class B : public A
 template<class T>
 class B<T*> : public A
 {
-  mytype mem; // { dg-error "within this context" }
+  mytype mem; // { dg-message "within this context" }
 };
 
 B<int*> b;
Index: testsuite/g++.dg/template/typedef20.C
===================================================================
--- testsuite/g++.dg/template/typedef20.C	(revision 221865)
+++ testsuite/g++.dg/template/typedef20.C	(working copy)
@@ -20,7 +20,7 @@  template<typename T>
 struct y<T*> : public x
 {
   typedef x::type good;
-  typedef x::privtype bad; // { dg-error "within this context" }
+  typedef x::privtype bad; // { dg-message "within this context" }
 };
 
 template class y<int>;
Index: testsuite/g++.dg/template/typedef22.C
===================================================================
--- testsuite/g++.dg/template/typedef22.C	(revision 221865)
+++ testsuite/g++.dg/template/typedef22.C	(working copy)
@@ -11,7 +11,7 @@  struct B
 
 template <typename T>
 struct A : B<T> {
-  typedef typename B<char>::M N; // { dg-error "context" }
+  typedef typename B<char>::M N; // { dg-message "context" }
   A (int = N ());
 };
 
Index: testsuite/g++.dg/template/using16.C
===================================================================
--- testsuite/g++.dg/template/using16.C	(revision 221865)
+++ testsuite/g++.dg/template/using16.C	(working copy)
@@ -22,7 +22,7 @@  struct C : A<T>, B<T>
 
     void f()
     {
-	type j; // { dg-error "context" }
+	type j; // { dg-message "context" }
     }
 };
 
Index: testsuite/g++.dg/template/virtual3.C
===================================================================
--- testsuite/g++.dg/template/virtual3.C	(revision 221865)
+++ testsuite/g++.dg/template/virtual3.C	(working copy)
@@ -7,5 +7,5 @@  template<int> class A
 
 struct B : A<0>, A<1>		// { dg-error "deleted|context" }
 {
-  B() {}			// { dg-error "context" }
+  B() {}			// { dg-message "context" }
 };
Index: testsuite/g++.dg/ubsan/pr61272.C
===================================================================
--- testsuite/g++.dg/ubsan/pr61272.C	(revision 221865)
+++ testsuite/g++.dg/ubsan/pr61272.C	(working copy)
@@ -12,7 +12,7 @@  namespace std
   };
   namespace __gnu_cxx
   {
-    template < typename _Alloc > struct __alloc_traits:std::allocator_traits < _Alloc > // { dg-error "within this context" }
+    template < typename _Alloc > struct __alloc_traits:std::allocator_traits < _Alloc > // { dg-message "within this context" }
     {
       typedef std::allocator_traits < _Alloc > _Base_type;
       using _Base_type::construct;
Index: testsuite/g++.old-deja/g++.bob/inherit2.C
===================================================================
--- testsuite/g++.old-deja/g++.bob/inherit2.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.bob/inherit2.C	(working copy)
@@ -10,7 +10,7 @@  class A {
   const A& operator =(const A &) { abort(); }
 };
 
-class B : public A { // { dg-error "" }
+class B : public A { // { dg-message "" }
 public:
   B(void) {}
 };
Index: testsuite/g++.old-deja/g++.brendan/crash11.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/crash11.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.brendan/crash11.C	(working copy)
@@ -14,7 +14,7 @@  class A {
 
 class B : public A {
     public:
-	virtual void f1() { printf("i=%d j=%d\n",i,j); }// { dg-error "" }  member.*// ERROR -  member.*
+	virtual void f1() { printf("i=%d j=%d\n",i,j); }// { dg-message "" }  member.*// ERROR -  member.*
 	friend virtual void f2() { printf("i=%d j=%d\n",i,j); }// { dg-error "" }  virtual.*// ERROR -  member.*// ERROR -  member.*
 };
 
Index: testsuite/g++.old-deja/g++.brendan/enum6.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/enum6.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.brendan/enum6.C	(working copy)
@@ -11,6 +11,6 @@  void h(X* p) {
     X::E2 e2;
     int x2 = X::a2;
 
-    X::E1 e1;	     // { dg-error "" } within this context
-    int x1 = X::a1;  // { dg-error "" } within this context
+    X::E1 e1;	     // { dg-message "" } within this context
+    int x1 = X::a1;  // { dg-message "" } within this context
     }
Index: testsuite/g++.old-deja/g++.brendan/visibility1.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility1.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.brendan/visibility1.C	(working copy)
@@ -12,5 +12,5 @@  class bar : public foo {
 
 void baz (foo *f)
 {
-  f->i = 1;	// error: i is protected// { dg-error "" } .*
+  f->i = 1;	// error: i is protected// { dg-message "" } .*
 }
Index: testsuite/g++.old-deja/g++.brendan/visibility10.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility10.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.brendan/visibility10.C	(working copy)
@@ -9,6 +9,6 @@  struct base
 struct derived : public base
 {
     protected:
-        void derived_func(base *ptr) { ptr->base_func(); }// { dg-error "" }  within this context
+        void derived_func(base *ptr) { ptr->base_func(); }// { dg-message "" }  within this context
 };
 
Index: testsuite/g++.old-deja/g++.brendan/visibility2.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility2.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.brendan/visibility2.C	(working copy)
@@ -6,5 +6,5 @@  class X {
   void g (double);
 };
 	
-class Y : public X { void f() { g (1); } }; // { dg-error "" } private
+class Y : public X { void f() { g (1); } }; // { dg-message "" } private
 
Index: testsuite/g++.old-deja/g++.brendan/visibility6.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility6.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.brendan/visibility6.C	(working copy)
@@ -13,5 +13,5 @@  class middle : private bottom
 class top : public middle
 {
 public:
-  void bar () { b; }// { dg-error "" } .*
+  void bar () { b; }// { dg-message "" } .*
 };
Index: testsuite/g++.old-deja/g++.brendan/visibility8.C
===================================================================
--- testsuite/g++.old-deja/g++.brendan/visibility8.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.brendan/visibility8.C	(working copy)
@@ -11,5 +11,5 @@  class foo1 : private foo
 { };
 class foo2 : public foo1
 { public:
-  void bar () { y; }// { dg-error "" } .*
+  void bar () { y; }// { dg-message "" } .*
 };
Index: testsuite/g++.old-deja/g++.bugs/900428_03.C
===================================================================
--- testsuite/g++.old-deja/g++.bugs/900428_03.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.bugs/900428_03.C	(working copy)
@@ -25,7 +25,7 @@  struct struct_1 : public struct_0 {
   struct_1 ();
 };
 
-struct_1::struct_1 () : struct_0 (8,9) // { dg-error "within this context" }
+struct_1::struct_1 () : struct_0 (8,9) // { dg-message "within this context" }
 {
 }
 
@@ -35,7 +35,7 @@  struct struct_2 {
   struct_2 ();
 };
 
-struct_2::struct_2 () : struct_2_data_member (8,9) // { dg-error "within this context" }
+struct_2::struct_2 () : struct_2_data_member (8,9) // { dg-message "within this context" }
 {
 }
 
Index: testsuite/g++.old-deja/g++.jason/access17.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access17.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.jason/access17.C	(working copy)
@@ -12,8 +12,8 @@  struct B: public A {
   static int (A::*fp)();
 };
 
-int A::* B::p = &A::i;         // { dg-error "" } 
-int (A::* B::fp)() = &A::f;    // { dg-error "" }
+int A::* B::p = &A::i;         // { dg-message "" } 
+int (A::* B::fp)() = &A::f;    // { dg-message "" }
 
 struct C {
   static int A::*p;
@@ -20,5 +20,5 @@  struct C {
   static int (A::*fp)();
 };
 
-int A::* C::p = &A::i;		// { dg-error "" } 
-int (A::* C::fp)() = &A::f;	// { dg-error "" } 
+int A::* C::p = &A::i;		// { dg-message "" } 
+int (A::* C::fp)() = &A::f;	// { dg-message "" } 
Index: testsuite/g++.old-deja/g++.jason/access18.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access18.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.jason/access18.C	(working copy)
@@ -12,9 +12,9 @@  class A {
     
 class B : public A {
   public:
-    B(): A() {}			// { dg-error "" } 
-    B(const B&) {}		// { dg-error "" } 
-    ~B() { }			// { dg-error "" } private dtor
+    B(): A() {}			// { dg-message "" } 
+    B(const B&) {}		// { dg-message "" } 
+    ~B() { }			// { dg-message "" } private dtor
 };
 
 main()
Index: testsuite/g++.old-deja/g++.jason/access22.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access22.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.jason/access22.C	(working copy)
@@ -12,7 +12,7 @@  class A
 
 struct B : public A
 {
-    void func() { foo(); }	// { dg-error "" } 
+    void func() { foo(); }	// { dg-message "" } 
 };
 
 int main()
Index: testsuite/g++.old-deja/g++.jason/access23.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/access23.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.jason/access23.C	(working copy)
@@ -50,11 +50,11 @@  struct Bar : public Foo {
     PRT_A = 0;
     PRT.B = 0;		
     printf("%x\n",Foo::PRT.pY);	
-    PRV_A = 0;			// { dg-error "" } 
-    Foo::C = 0;			// { dg-error "" } 
-    printf("%x\n",pZ);  	// { dg-error "" } 
-    Foo::PRV.C = 0;		// { dg-error "" } 
-    printf("%x\n",PRV.pZ); 	// { dg-error "" } 
+    PRV_A = 0;			// { dg-message "" } 
+    Foo::C = 0;			// { dg-message "" } 
+    printf("%x\n",pZ);  	// { dg-message "" } 
+    Foo::PRV.C = 0;		// { dg-message "" } 
+    printf("%x\n",PRV.pZ); 	// { dg-message "" } 
   }
 };
 
@@ -65,16 +65,16 @@  int main()
   a.PUB_A = 0;
   a.A = 0;
   printf("%x\n",a.pX);  
-  a.PRT_A = 0;			// { dg-error "" } 
-  a.B = 0;			// { dg-error "" } 
-  printf("%x\n",a.pY);  	// { dg-error "" } 
-  a.PRV_A = 0;			// { dg-error "" } 
-  a.C = 0;			// { dg-error "" } 
-  printf("%x\n",a.pZ);  	// { dg-error "" } 
+  a.PRT_A = 0;			// { dg-message "" } 
+  a.B = 0;			// { dg-message "" } 
+  printf("%x\n",a.pY);  	// { dg-message "" } 
+  a.PRV_A = 0;			// { dg-message "" } 
+  a.C = 0;			// { dg-message "" } 
+  printf("%x\n",a.pZ);  	// { dg-message "" } 
   a.PUB.A = 0;
   printf("%x\n",a.PUB.pX);  
-  a.PRT.B = 0;			// { dg-error "" } 
-  printf("%x\n",a.PRT.pY);  	// { dg-error "" } 
-  a.PRV.C = 0;			// { dg-error "" } 
-  printf("%x\n",a.PRV.pZ);  	// { dg-error "" } 
+  a.PRT.B = 0;			// { dg-message "" } 
+  printf("%x\n",a.PRT.pY);  	// { dg-message "" } 
+  a.PRV.C = 0;			// { dg-message "" } 
+  printf("%x\n",a.PRV.pZ);  	// { dg-message "" } 
 }
Index: testsuite/g++.old-deja/g++.jason/delete3.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/delete3.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.jason/delete3.C	(working copy)
@@ -15,5 +15,5 @@  A::~A()
 
 void foo(A *p)
 {
-  delete p;			// { dg-error "" } in this context
+  delete p;			// { dg-message "" } in this context
 }
Index: testsuite/g++.old-deja/g++.jason/report.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/report.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.jason/report.C	(working copy)
@@ -50,9 +50,9 @@  typedef int const * bart ();
 typedef bart const * const * bar2;
 typedef bart volatile * const * bar2v;
 
-bar2 baz (X::Y y)	        // { dg-error "" } in this context
+bar2 baz (X::Y y)	        // { dg-message "" } in this context
 {
-  X::Y f;			// { dg-error "" } in this context
+  X::Y f;			// { dg-message "" } in this context
   bar2 wa [5];
   wa[0] = baz(f);
   undef2 (1); // { dg-error "" } implicit declaration
Index: testsuite/g++.old-deja/g++.law/access2.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access2.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/access2.C	(working copy)
@@ -16,5 +16,5 @@  template <class T> class Foo
 
 int main()
 {
-    Foo<int>(1);// { dg-error "" } 
+    Foo<int>(1);// { dg-message "" } 
 }
Index: testsuite/g++.old-deja/g++.law/access3.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access3.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/access3.C	(working copy)
@@ -12,5 +12,5 @@ 
           void g (double);
         };
 
-        class Y : public X { void f() { g (1); } };// { dg-error "" } 
+        class Y : public X { void f() { g (1); } };// { dg-message "" } 
 
Index: testsuite/g++.old-deja/g++.law/access4.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access4.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/access4.C	(working copy)
@@ -19,9 +19,9 @@  class Sterile : private virtual ForceLeafSterile {
 
 class Illegitimate : public Sterile {
 public:
-    Illegitimate() {}           // { dg-error "" }  can't access virtual base deflt ctor
+    Illegitimate() {}           // { dg-message "" }  can't access virtual base deflt ctor
     Illegitimate(const char* /*blah*/)
-        : ForceLeafSterile() {} // { dg-error "" } can't access default ctor
+        : ForceLeafSterile() {} // { dg-message "" } can't access default ctor
     Illegitimate(const Illegitimate&)
-        {}                      // { dg-error "" } can't access default ctor
+        {}                      // { dg-message "" } can't access default ctor
 };
Index: testsuite/g++.old-deja/g++.law/access5.C
===================================================================
--- testsuite/g++.old-deja/g++.law/access5.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/access5.C	(working copy)
@@ -19,6 +19,6 @@  class enclose {
 class derived : public enclose {
   nested_public obj1;     // ok
   nested_protected obj2;  // ok
-  nested_private obj3;    // error// { dg-error "" } in this context
+  nested_private obj3;    // error// { dg-message "" } in this context
 };
 
Index: testsuite/g++.old-deja/g++.law/arm12.C
===================================================================
--- testsuite/g++.old-deja/g++.law/arm12.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/arm12.C	(working copy)
@@ -32,7 +32,7 @@  void X::f()
   std::cout << "X::f()" << std::endl;
 }
 
-Y::Y() // { dg-error "within this context" }
+Y::Y() // { dg-message "within this context" }
 {
   std::cout << "Y::Y()" << std::endl;
 }
Index: testsuite/g++.old-deja/g++.law/arm14.C
===================================================================
--- testsuite/g++.old-deja/g++.law/arm14.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/arm14.C	(working copy)
@@ -18,7 +18,7 @@  void h(X* p) {
     X::E2 e2;
     int x2 = X::a2;
 
-    X::E1 e1;                   // { dg-error "" } within this context
-    int x1 = X::a1;             // { dg-error "" } Should be rejected, and is.
+    X::E1 e1;                   // { dg-message "" } within this context
+    int x1 = X::a1;             // { dg-message "" } Should be rejected, and is.
     }
 
Index: testsuite/g++.old-deja/g++.law/ctors13.C
===================================================================
--- testsuite/g++.old-deja/g++.law/ctors13.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/ctors13.C	(working copy)
@@ -7,7 +7,7 @@  class A {
 };
 
 int main() {
-  A* a = new A();// { dg-error "" } .*
+  A* a = new A();// { dg-message "" } .*
   if (a) {
      std::cout << "a != NULL\n";
   } else {
Index: testsuite/g++.old-deja/g++.law/union2.C
===================================================================
--- testsuite/g++.old-deja/g++.law/union2.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/union2.C	(working copy)
@@ -20,6 +20,6 @@  void f() {
   A a;
 
   a.x = 0;
-  a.y = 1;// { dg-error "" } .*
-  a.z = 2;// { dg-error "" } 
+  a.y = 1;// { dg-message "" } .*
+  a.z = 2;// { dg-message "" } 
 }
Index: testsuite/g++.old-deja/g++.law/visibility12.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility12.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility12.C	(working copy)
@@ -13,6 +13,6 @@  class b : private a {
         };
 
 class c : public b {
-        int xx(void) { return (aa); }  // aa should be invisible// { dg-error "" } .*
+        int xx(void) { return (aa); }  // aa should be invisible// { dg-message "" } .*
         };
 
Index: testsuite/g++.old-deja/g++.law/visibility15.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility15.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility15.C	(working copy)
@@ -21,5 +21,5 @@  class X {
 
 int main(void)
 {
-  X* p = new X;// { dg-error "" } .*
+  X* p = new X;// { dg-message "" } .*
 }
Index: testsuite/g++.old-deja/g++.law/visibility16.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility16.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility16.C	(working copy)
@@ -17,7 +17,7 @@  class B : public A {
     int bstuff;
   public:
     B( A *p) {
-        bstuff = p->astuff;// { dg-error "" } .*
+        bstuff = p->astuff;// { dg-message "" } .*
     }
 };
 
Index: testsuite/g++.old-deja/g++.law/visibility17.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility17.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility17.C	(working copy)
@@ -42,12 +42,12 @@  Base::Base(char* str) // { dg-error "is private" }
     name_ = std::strcpy(new char[std::strlen(str) + 1], str);
 }
 
-Derived::Derived(int n, char* str) : Base(str) // { dg-error "within this context" }
+Derived::Derived(int n, char* str) : Base(str) // { dg-message "within this context" }
 {
   num_ = n;
 }
 
-Derived::Derived(int n) : Base() // { dg-error "within this context" }
+Derived::Derived(int n) : Base() // { dg-message "within this context" }
 {
   num_ = n;
 }
Index: testsuite/g++.old-deja/g++.law/visibility18.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility18.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility18.C	(working copy)
@@ -15,6 +15,6 @@  struct T3 : public T1, private T2 {
 int main ()
 {
     x.i = 1;
-    x.j = 2;    // error: x.j is private// { dg-error "" } .*
+    x.j = 2;    // error: x.j is private// { dg-message "" } .*
     return 0;
 }
Index: testsuite/g++.old-deja/g++.law/visibility19.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility19.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility19.C	(working copy)
@@ -20,21 +20,21 @@  class D2 : public B {
 
 void fr(B* pb, D1* p1, D2* p2)
 {
-    pb->i = 1;  // illegal// { dg-error "" } .*
-    p1->i = 2;  // illegal// { dg-error "" } .*
+    pb->i = 1;  // illegal// { dg-message "" } .*
+    p1->i = 2;  // illegal// { dg-message "" } .*
     p2->i = 3;  // ok (access through D2)
 }
 
 void D2::mem(B* pb, D1* p1)
 {
-    pb->i = 1;  // illegal// { dg-error "" } .*
-    p1->i = 2;  // illegal// { dg-error "" } .*
+    pb->i = 1;  // illegal// { dg-message "" } .*
+    p1->i = 2;  // illegal// { dg-message "" } .*
     i = 3;      // ok (access through `this')
 }
 
 void g(B* pb, D1* p1, D2* p2)
 {
-    pb->i = 1;  // illegal// { dg-error "" } .*
-    p1->i = 2;  // illegal// { dg-error "" } .*
-    p2->i = 3;  // illegal// { dg-error "" } .*
+    pb->i = 1;  // illegal// { dg-message "" } .*
+    p1->i = 2;  // illegal// { dg-message "" } .*
+    p2->i = 3;  // illegal// { dg-message "" } .*
 }
Index: testsuite/g++.old-deja/g++.law/visibility20.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility20.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility20.C	(working copy)
@@ -23,7 +23,7 @@  class Derived : public Base {
 
 void
 Derived::noticeThisFunction(Base *b) {
-    b->protectedBaseFunction(); // ARM says this is not allowed// { dg-error "" } .*
+    b->protectedBaseFunction(); // ARM says this is not allowed// { dg-message "" } .*
                                 // since it is not called on 'this'
 }
 
Index: testsuite/g++.old-deja/g++.law/visibility21.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility21.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility21.C	(working copy)
@@ -13,5 +13,5 @@  class A {
 class B : public A
 {
         void bar(A &a)
-                {       a.foo(); }// { dg-error "" } .*
+                {       a.foo(); }// { dg-message "" } .*
 };
Index: testsuite/g++.old-deja/g++.law/visibility4.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility4.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility4.C	(working copy)
@@ -20,6 +20,6 @@  extern "C" int printf( const char *, ...);
 
 class E : public C {
         void f() {
-                printf( "%d\n", b);// { dg-error "" } .*
+                printf( "%d\n", b);// { dg-message "" } .*
         }
 };
Index: testsuite/g++.old-deja/g++.law/visibility5.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility5.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility5.C	(working copy)
@@ -13,5 +13,5 @@  class a {
 void test ()
 {
   a *ap = new a;
-  a *ap2 = new a (3);// { dg-error "" } .*
+  a *ap2 = new a (3);// { dg-message "" } .*
 }
Index: testsuite/g++.old-deja/g++.law/visibility8.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility8.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility8.C	(working copy)
@@ -23,4 +23,4 @@  class t3 : public t2 {
 };
 
 
-int t3::ttt() { return a; }// { dg-error "" } .*
+int t3::ttt() { return a; }// { dg-message "" } .*
Index: testsuite/g++.old-deja/g++.law/visibility9.C
===================================================================
--- testsuite/g++.old-deja/g++.law/visibility9.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.law/visibility9.C	(working copy)
@@ -18,5 +18,5 @@  class B : public A {
 
 
 void B::f1(A* pa) {
-    pa->a = 1;    // illegal but allowed by gcc// { dg-error "" } .*
+    pa->a = 1;    // illegal but allowed by gcc// { dg-message "" } .*
 }
Index: testsuite/g++.old-deja/g++.niklas/t135.C
===================================================================
--- testsuite/g++.old-deja/g++.niklas/t135.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.niklas/t135.C	(working copy)
@@ -16,7 +16,7 @@  class C2 C2_object;
 
 template <class T> void C1<T>::diddle_C2 ()
 {
-  C2_object.data_member = 99; // { dg-error "" }
+  C2_object.data_member = 99; // { dg-message "" }
 }
 
 C1<int> C1_int_object;
Index: testsuite/g++.old-deja/g++.oliva/delete1.C
===================================================================
--- testsuite/g++.old-deja/g++.oliva/delete1.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.oliva/delete1.C	(working copy)
@@ -18,7 +18,7 @@  struct foo {
 
 struct bar : foo {
   ~bar() {
-    delete this; // { dg-error "" } delete is private
+    delete this; // { dg-message "" } delete is private
     // An implicit invocation of delete is emitted in destructors, but
     // it should only be checked in virtual destructors
   } // { dg-bogus "" } not virtual
@@ -25,7 +25,7 @@  struct bar : foo {
 } bar_;
 
 struct baz : foo {
-  virtual ~baz() {} // { dg-error "" } delete is private in vdtor
+  virtual ~baz() {} // { dg-message "" } delete is private in vdtor
 } baz_;
 
 struct bad : baz {} bad_; // { dg-message "" } delete is private in vdtor
Index: testsuite/g++.old-deja/g++.oliva/partord1.C
===================================================================
--- testsuite/g++.old-deja/g++.oliva/partord1.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.oliva/partord1.C	(working copy)
@@ -17,7 +17,7 @@  template <typename T> void foo(T) {
   bar<T>().i; // ok, I'm a friend
 }
 template <typename T> void foo(T*) {
-  bar<T*>().i; // { dg-error "" } not a friend
+  bar<T*>().i; // { dg-message "" } not a friend
 }
 
 int main() {
Index: testsuite/g++.old-deja/g++.other/access11.C
===================================================================
--- testsuite/g++.old-deja/g++.other/access11.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/access11.C	(working copy)
@@ -16,5 +16,5 @@  int main()
 {
   A a;
  
-  a.g<int>(0); // { dg-error "" } private
+  a.g<int>(0); // { dg-message "" } private
 }
Index: testsuite/g++.old-deja/g++.other/access4.C
===================================================================
--- testsuite/g++.old-deja/g++.other/access4.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/access4.C	(working copy)
@@ -7,5 +7,5 @@  struct A { // { dg-error "" } inaccessible
 struct B : private A { };
 
 struct C : public B {
-  int f () { return A::i; } // { dg-error "" } context
+  int f () { return A::i; } // { dg-message "" } context
 };
Index: testsuite/g++.old-deja/g++.other/access7.C
===================================================================
--- testsuite/g++.old-deja/g++.other/access7.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/access7.C	(working copy)
@@ -19,8 +19,8 @@  class D: public A {
 
 void D::E::f ()
 {
-  int i = I1;			// { dg-error "" } within this context
-  B1 b1;			// { dg-error "" } within this context
+  int i = I1;			// { dg-message "" } within this context
+  B1 b1;			// { dg-message "" } within this context
   i = I2;
   B2 b2;
 }
@@ -27,7 +27,7 @@  void D::E::f ()
 
 void f ()
 {
-  A::B1 b1;			// { dg-error "" } within this context
-  new A::B1;			// { dg-error "" } within this context
-  (A::B1) b1;			// { dg-error "" } within this context
+  A::B1 b1;			// { dg-message "" } within this context
+  new A::B1;			// { dg-message "" } within this context
+  (A::B1) b1;			// { dg-message "" } within this context
 }
Index: testsuite/g++.old-deja/g++.other/crash7.C
===================================================================
--- testsuite/g++.old-deja/g++.other/crash7.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/crash7.C	(working copy)
@@ -7,5 +7,5 @@  void f()
     int i; // { dg-error "" } private
   } u;
 
-  u.i = 3; // { dg-error "" } within this context
+  u.i = 3; // { dg-message "" } within this context
 }
Index: testsuite/g++.old-deja/g++.other/friend1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/friend1.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/friend1.C	(working copy)
@@ -51,7 +51,7 @@  D d;
 
 void f()
 {
-    b.i = 3; // { dg-error "" } protected
+    b.i = 3; // { dg-message "" } protected
     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-message "" } protected
     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-message "" } protected
   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-message "" } protected
   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 221865)
+++ testsuite/g++.old-deja/g++.other/friend4.C	(working copy)
@@ -14,8 +14,8 @@  template <class C> class bar {
   template <class B> friend void foo<C,B>(); // { dg-error "" } bogus declaration
 };
 template <class A, class B> void foo() {
-  bar<A> baz; baz.i = 1;   // { dg-error "" } foo cannot access bar<int>::i
-  bar<int> buz; buz.i = 1; // { dg-error "" } foo cannot access bar<int>::i
+  bar<A> baz; baz.i = 1;   // { dg-message "" } foo cannot access bar<int>::i
+  bar<int> buz; buz.i = 1; // { dg-message "" } foo cannot access bar<int>::i
 }
 int main() {
   foo<void,void>();
Index: testsuite/g++.old-deja/g++.other/friend9.C
===================================================================
--- testsuite/g++.old-deja/g++.other/friend9.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/friend9.C	(working copy)
@@ -12,7 +12,7 @@  class F
 
 class C
 {
-  friend class F::Internal; // { dg-error "" } in this context
+  friend class F::Internal; // { dg-message "" } in this context
   public:
   typedef enum { A, B } e;
 
Index: testsuite/g++.old-deja/g++.other/lineno1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/lineno1.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/lineno1.C	(working copy)
@@ -9,7 +9,7 @@  class A
   ~A();				// { dg-error "" } private
 };
 
-static A a;			// { dg-error "" } here
+static A a;			// { dg-message "" } here
 
 
 
Index: testsuite/g++.old-deja/g++.other/using1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/using1.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.other/using1.C	(working copy)
@@ -10,7 +10,7 @@  class B {
   friend class D2;
 };
 
-class D : public B { // { dg-error "" } within this context
+class D : public B { // { dg-message "" } within this context
 public:
   using B::a;
   using B::b;
Index: testsuite/g++.old-deja/g++.pt/enum14.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/enum14.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.pt/enum14.C	(working copy)
@@ -30,7 +30,7 @@  struct B
 
 struct D: public B<int>
 {
-  void choke (foo);   // { dg-error "" } within this context
-  void choke (baz);   // { dg-error "" } within this context
+  void choke (foo);   // { dg-message "" } within this context
+  void choke (baz);   // { dg-message "" } within this context
 };
 
Index: testsuite/g++.old-deja/g++.pt/friend11.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/friend11.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.pt/friend11.C	(working copy)
@@ -9,7 +9,7 @@  struct S
   void f(U u)
     {
       C<U> cu;
-      cu.i = 3; // { dg-error "" } S<double>::f<U> is a friend, but this is
+      cu.i = 3; // { dg-message "" } S<double>::f<U> is a friend, but this is
                 //         S<int>::f<double>. 
     }
 };
Index: testsuite/g++.old-deja/g++.pt/friend21.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/friend21.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.pt/friend21.C	(working copy)
@@ -24,7 +24,7 @@  void A<T>::f()
   B<T>::i = 3;
   C<T>::i = 3;
   C<double>::i = 3;
-  B<double>::i = 3; // { dg-error "" } member `i' is private
+  B<double>::i = 3; // { dg-message "" } member `i' is private
 }
 
 template void A<int>::f();
Index: testsuite/g++.old-deja/g++.pt/friend3.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/friend3.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.pt/friend3.C	(working copy)
@@ -15,7 +15,7 @@  template <class T>
 void f(T)
 {
   C c;
-  c.i = 3; // { dg-error "" } f<double> is a friend, this is f<int>.
+  c.i = 3; // { dg-message "" } f<double> is a friend, this is f<int>.
 }
 
 
Index: testsuite/g++.old-deja/g++.pt/inherit2.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/inherit2.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.pt/inherit2.C	(working copy)
@@ -41,7 +41,7 @@  template <class T> struct A<T>::AC
 {
   T M ()
   {
-    return B<T>::valueA_AC;	// { dg-error "" "" } within this context - 
+    return B<T>::valueA_AC;	// { dg-message "" "" } within this context - 
   }
 };
 
Index: testsuite/g++.old-deja/g++.pt/memtemp74.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/memtemp74.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.pt/memtemp74.C	(working copy)
@@ -16,6 +16,6 @@  class S
 void f()
 {
   S<double> s;
-  s.f(3); // { dg-error "" } within this context
-  s.g(2.0); // { dg-error "" } within this context
+  s.f(3); // { dg-message "" } within this context
+  s.g(2.0); // { dg-message "" } within this context
 }
Index: testsuite/g++.old-deja/g++.pt/memtemp89.C
===================================================================
--- testsuite/g++.old-deja/g++.pt/memtemp89.C	(revision 221865)
+++ testsuite/g++.old-deja/g++.pt/memtemp89.C	(working copy)
@@ -12,4 +12,4 @@  template<template<class> class XX>
 class Y {
 	XX<int> x_;
 };
-Y<Q::X> y;			// { dg-error "" } required from here
+Y<Q::X> y;			// { dg-message "" } required from here