Blame SOURCES/gcc32-pr13106.patch

727081
2005-09-23  Alexandre Oliva  <aoliva@redhat.com>
727081
727081
	* decl.c (finish_function): Skip no-return-statment warning if
727081
	the return type uses template parms.
727081
727081
	* g++.dg/warn/return-void-1.C: New test.
727081
727081
--- gcc/cp/decl.c.orig
727081
+++ gcc/cp/decl.c
727081
@@ -14475,7 +14475,8 @@ finish_function (flags)
727081
       && !DECL_NAME (DECL_RESULT (fndecl))
727081
       /* Normally, with -Wreturn-type, flow will complain.  Unless we're an
727081
 	 inline function, as we might never be compiled separately.  */
727081
-      && (DECL_INLINE (fndecl) || processing_template_decl))
727081
+      && (DECL_INLINE (fndecl) || processing_template_decl)
727081
+      && !uses_template_parms (TREE_TYPE (fntype)))
727081
     warning ("no return statement in function returning non-void");
727081
     
727081
   /* Clear out memory we no longer need.  */
727081
--- gcc/testsuite/g++.dg/warn/return-void-1.C
727081
+++ gcc/testsuite/g++.dg/warn/return-void-1.C
727081
@@ -0,0 +1,15 @@
727081
+// { dg-do compile }
727081
+// { dg-options "-Wall" }
727081
+
727081
+template <typename T> T dummy1() {}
727081
+template <typename T> T dummy2() {} // { dg-warning "end of non-void" }
727081
+template <typename T> inline T dummy3() {}
727081
+template <typename T> inline T dummy4() {} // { dg-warning "end of non-void|no return statement" }
727081
+
727081
+int main()
727081
+{
727081
+  dummy1<void>();
727081
+  dummy2<int>(); // { dg-warning "instantiated from here" }
727081
+  dummy3<void>();
727081
+  dummy4<int>(); // { dg-warning "instantiated from here" }
727081
+}