This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: don't issue duplicate template errors


On Jan 31, 2005, Alexandre Oliva <aoliva@redhat.com> wrote:

> I'm yet to verify whether it will require tweaks in testcases; it's
> quite possible, and this may be the reason why I didn't submit it.

Yup, that must have been it.  Only the testcase added for the original
bug report needed tweaks.

Index: gcc/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* g++.dg/parse/typename7.C: Adjust error messages.

Index: gcc/testsuite/g++.dg/parse/typename7.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/parse/typename7.C,v
retrieving revision 1.1
diff -u -p -r1.1 typename7.C
--- gcc/testsuite/g++.dg/parse/typename7.C 9 Dec 2004 12:33:09 -0000 1.1
+++ gcc/testsuite/g++.dg/parse/typename7.C 31 Jan 2005 19:25:09 -0000
@@ -9,23 +9,23 @@ struct A
 {
   template<typename>   void foo(int);
   template<typename T> void bar(T t) {
-    this->foo<typename T>(t); } // { dg-error "expected" }
+    this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
   template<typename T> void bad(T t) {
-    foo<typename T>(t); } // { dg-error "expected" }
+    foo<typename T>(t); } // { dg-error "expected|parse error" }
 };
 
 template <typename T>
 struct B
 {
   void bar(T t) {
-    A().bar<typename T>(t); } // { dg-error "expected" }
+    A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
   void bad(T t) {
     B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
 };
 
 void baz()
 {
-    A().bar(0);
-    A().bad(0);
-    B<int>().bar(0);
+  A().bar(0);
+  A().bad(0);
+  B<int>().bar(0);
 }
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]