Commit 15f18aac by Richard Henderson Committed by Richard Henderson

crash13.C: Pass -Wreturn-type.

        * g++.old-deja/g++.brendan/crash13.C: Pass -Wreturn-type.
        * g++.old-deja/g++.brendan/crash52.C: Likewise.
        * g++.old-deja/g++.jason/report.C: Likewise.
        * g++.old-deja/g++.law/friend5.C: Likewise.
        * g++.old-deja/g++.mike/p646.C: Likewise.  Adjust the spelling
        of the expected warnings.

From-SVN: r36768
parent c7053b70
2000-10-06 Richard Henderson <rth@cygnus.com>
* g++.old-deja/g++.brendan/crash13.C: Pass -Wreturn-type.
* g++.old-deja/g++.brendan/crash52.C: Likewise.
* g++.old-deja/g++.jason/report.C: Likewise.
* g++.old-deja/g++.law/friend5.C: Likewise.
* g++.old-deja/g++.mike/p646.C: Likewise. Adjust the spelling
of the expected warnings.
2000-10-06 Nathan Sidwell <nathan@codesourcery.com> 2000-10-06 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/enum14.C: New test. * g++.old-deja/g++.pt/enum14.C: New test.
......
// Build don't link: // Build don't link:
// GROUPS passed old-abort // GROUPS passed old-abort
// Special g++ Options: -Wreturn-type
class gen_op class gen_op
{ {
public: public:
......
// Build don't link: // Build don't link:
// GROUPS passed old-abort // GROUPS passed old-abort
// Special g++ Options: -Wreturn-type
#include <iostream.h> #include <iostream.h>
class A { class A {
......
// Build don't link: // Build don't link:
// GROUPS passed error-reporting // GROUPS passed error-reporting
// Special g++ Options: -Wreturn-type
template <char C> template <char C>
class badoo class badoo
{ {
......
// Build don't link: // Build don't link:
// GROUPS passed friends // GROUPS passed friends
// Special g++ Options: -Wreturn-type
extern "C" int good_friend(int); extern "C" int good_friend(int);
extern "C" int bad_friend(); extern "C" int bad_friend();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
*/ */
// Special g++ Options: -Wno-deprecated // Special g++ Options: -Wno-deprecated -Wreturn-type
extern "C" extern "C"
{ {
...@@ -107,7 +107,7 @@ warn_return_1 () ...@@ -107,7 +107,7 @@ warn_return_1 ()
{ {
foo f; foo f;
printf ("returning 1\n"); printf ("returning 1\n");
} // WARNING - no return statement } // WARNING - control reaches end
int int
warn_return_arg (int arg) warn_return_arg (int arg)
...@@ -115,7 +115,7 @@ warn_return_arg (int arg) ...@@ -115,7 +115,7 @@ warn_return_arg (int arg)
foo f; foo f;
printf ("returning %d\n", arg); printf ("returning %d\n", arg);
arg; arg;
} // WARNING - no return statement } // WARNING - control reaches end
int int
warn_return_sum (int x, int y) warn_return_sum (int x, int y)
...@@ -123,14 +123,14 @@ warn_return_sum (int x, int y) ...@@ -123,14 +123,14 @@ warn_return_sum (int x, int y)
foo f; foo f;
printf ("returning %d+%d\n", x, y); printf ("returning %d+%d\n", x, y);
x + y; x + y;
} // WARNING - no return statement } // WARNING - control reaches end
foo foo
warn_return_foo () warn_return_foo ()
{ {
foo f; foo f;
printf ("returning foo\n"); printf ("returning foo\n");
} // WARNING - no return statement } // WARNING - control reaches end
foo foo
nowarn_return_named_foo () return f nowarn_return_named_foo () return f
...@@ -142,10 +142,10 @@ foo ...@@ -142,10 +142,10 @@ foo
warn_foo_parm_returns_foo (foo f) warn_foo_parm_returns_foo (foo f)
{ {
f; f;
} // WARNING - no return statement } // WARNING - control reaches end
main () main ()
{ { // WARNING - no type
int ii = return_1 (); int ii = return_1 ();
if (ii != 1) if (ii != 1)
abort_because ("wrong value returned"); abort_because ("wrong value returned");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment