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]

C++ PATCHes for buglets



Here are fixes for a couple of recently reported bugs.

-- 
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-05-05  Mark Mitchell  <mark@codesourcery.com>

	* decl2.c (start_objects): Don't let static constructors and
	destructors get inlined.

	* parse.y (nested_name_specifier): Make sure ordinary types are
	complete, just like template types.
	* parse.c: Regenerated.

	* pt.c (check_explicit_specialization): Improve error messages.

Index: testsuite/g++.old-deja/g++.other/init13.C
===================================================================
RCS file: init13.C
diff -N init13.C
--- /dev/null	Sat Dec  5 20:30:03 1998
+++ init13.C	Wed May  5 11:34:32 1999
@@ -0,0 +1,13 @@
+// Build don't run:
+// Special g++ Options: -O3
+// Origin: Gabriel Dos_Reis <Gabriel.Dos_Reis@sophia.inria.fr>
+
+void f() {}
+
+struct X {
+    ~X() { f (); }
+};
+
+X x;
+
+int main () {}
Index: testsuite/g++.old-deja/g++.pt/nested2.C
===================================================================
RCS file: nested2.C
diff -N nested2.C
--- /dev/null	Sat Dec  5 20:30:03 1998
+++ nested2.C	Wed May  5 11:34:33 1999
@@ -0,0 +1,15 @@
+// Build don't link:
+// Origin: Mathias Doreille <Mathias.Doreille@imag.fr>
+
+template<class T>
+struct  a {
+  struct b {
+    T operator()();
+  };
+};
+
+
+template<class T>
+T a<T>::b::operator()() { return T(0); }
+
+template<> int a<int>::b::operator()() { return 1; }
Index: cp/decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.212
diff -u -p -r1.212 decl2.c
--- decl2.c	1999/04/30 16:14:58	1.212
+++ decl2.c	1999/05/05 18:33:56
@@ -2918,6 +2918,13 @@ start_objects (method_type, initp)
   clear_last_expr ();
   push_momentary ();
   expand_start_bindings (0);
+
+  /* We cannot allow these functions to be elided, even if they do not
+     have external linkage.  And, there's no point in deferring
+     copmilation of thes functions; they're all going to have to be
+     out anyhow.  */
+  current_function_cannot_inline
+    = "static constructors and destructors cannot be inlined";
 }
 
 /* Finish the process of running a particular set of global constructors
Index: cp/parse.y
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/parse.y,v
retrieving revision 1.119
diff -u -p -r1.119 parse.y
--- parse.y	1999/04/22 17:36:48	1.119
+++ parse.y	1999/05/05 18:34:03
@@ -2954,7 +2954,8 @@ nested_name_specifier_1:
 		      $$ = lastiddecl;
 		      maybe_note_name_used_in_class ($1, $$);
 		    }
-		  got_scope = $$ = TYPE_MAIN_VARIANT (TREE_TYPE ($$));
+		  got_scope = $$ =
+		    complete_type (TYPE_MAIN_VARIANT (TREE_TYPE ($$)));
 		}
 	| SELFNAME SCOPE
 		{
Index: cp/pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.293
diff -u -p -r1.293 pt.c
--- pt.c	1999/04/28 13:14:20	1.293
+++ pt.c	1999/05/05 18:34:09
@@ -1429,9 +1429,8 @@ check_explicit_specialization (declarato
 	      
 	  if (fns == NULL_TREE) 
 	    {
-	      cp_error ("no member function `%s' declared in `%T'",
-			IDENTIFIER_POINTER (name),
-			ctype);
+	      cp_error ("no member function `%D' declared in `%T'",
+			name, ctype);
 	      return error_mark_node;
 	    }
 	  else


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