From 2f6f9ac7b6b62b13a488f5e7dbc7e1116330a714 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Sun, 5 Mar 2000 10:23:46 +0000 Subject: [PATCH] impint.C: New test. * g++.old-deja/g++.warn/impint.C: New test. * g++.old-deja/g++.martin/sts_vectini.C: Add -w option. * g++.old-deja/g++.pt/explicit10.C: Specify -w option. * g++.old-deja/g++.pt/explicit12.C: Likewise. * g++.old-deja/g++.pt/explicit13.C: Likewise. * g++.old-deja/g++.pt/explicit17.C: Likewise. * g++.old-deja/g++.pt/explicit18.C: Likewise. * g++.old-deja/g++.pt/explicit19.C: Likewise. * g++.old-deja/g++.pt/explicit23.C: Likewise. * g++.old-deja/g++.pt/explicit31.C: Likewise. * g++.old-deja/g++.pt/explicit35.C: Likewise. * g++.old-deja/g++.pt/explicit6.C: Likewise. * g++.old-deja/g++.pt/memclass7.C: Likewise. From-SVN: r32342 --- gcc/testsuite/ChangeLog | 16 ++++++ .../g++.old-deja/g++.martin/sts_vectini.C | 2 +- .../g++.old-deja/g++.pt/explicit10.C | 1 + .../g++.old-deja/g++.pt/explicit12.C | 1 + .../g++.old-deja/g++.pt/explicit13.C | 1 + .../g++.old-deja/g++.pt/explicit17.C | 1 + .../g++.old-deja/g++.pt/explicit18.C | 1 + .../g++.old-deja/g++.pt/explicit19.C | 1 + .../g++.old-deja/g++.pt/explicit23.C | 1 + .../g++.old-deja/g++.pt/explicit31.C | 1 + .../g++.old-deja/g++.pt/explicit35.C | 1 + gcc/testsuite/g++.old-deja/g++.pt/explicit6.C | 1 + gcc/testsuite/g++.old-deja/g++.pt/memclass7.C | 1 + gcc/testsuite/g++.old-deja/g++.warn/impint.C | 57 +++++++++++++++++++ 14 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.warn/impint.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f51ec94bf15..b13fcbc7d45 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2000-03-05 Nathan Sidwell + + * g++.old-deja/g++.warn/impint.C: New test. + * g++.old-deja/g++.martin/sts_vectini.C: Add -w option. + * g++.old-deja/g++.pt/explicit10.C: Specify -w option. + * g++.old-deja/g++.pt/explicit12.C: Likewise. + * g++.old-deja/g++.pt/explicit13.C: Likewise. + * g++.old-deja/g++.pt/explicit17.C: Likewise. + * g++.old-deja/g++.pt/explicit18.C: Likewise. + * g++.old-deja/g++.pt/explicit19.C: Likewise. + * g++.old-deja/g++.pt/explicit23.C: Likewise. + * g++.old-deja/g++.pt/explicit31.C: Likewise. + * g++.old-deja/g++.pt/explicit35.C: Likewise. + * g++.old-deja/g++.pt/explicit6.C: Likewise. + * g++.old-deja/g++.pt/memclass7.C: Likewise. + 2000-03-01 Zack Weinberg * gcc.dg/cpp-redef.c: New test. diff --git a/gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C b/gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C index 56f7a1c6a5e..f4701571385 100644 --- a/gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C +++ b/gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C @@ -1,4 +1,4 @@ -// Special g++ Options: -O2 +// Special g++ Options: -O2 -w // egcs-bugs 1999-02-22 14:24 Stefan Schwarzer // sts@ica1.uni-stuttgart.de // optimizer problem in egcs <= 1.1.1 diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit10.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit10.C index d90b8d05197..7f38f72c5b7 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit10.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit10.C @@ -1,5 +1,6 @@ // Build don't link: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template void foo(T t); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C index 0defb196116..820da3d62bc 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit12.C @@ -1,4 +1,5 @@ // Build don't run: +// Special g++ Options: -ansi -pedantic-errors -w // GROUPS passed templates template struct S diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C index fbb79013038..939158605e8 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit13.C @@ -1,5 +1,6 @@ // Build don't run: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template struct S diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit17.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit17.C index 8e8688df321..4abd17e4939 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit17.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit17.C @@ -1,5 +1,6 @@ // Build don't link: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template void foo(U u, T t); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C index 20c4b75d11e..b63fc3f2c62 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C @@ -1,5 +1,6 @@ // Build don't run: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template int foo(T t) { return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit19.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit19.C index b209bbe8672..3b29403e60b 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit19.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit19.C @@ -1,5 +1,6 @@ // Build don't run: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template int foo(T t); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C index cdffb15bc66..85fab0055d2 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C @@ -1,5 +1,6 @@ // Build don't run: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template int foo(T t) { return 1; } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit31.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit31.C index 61190f7f5f1..900ba1157e5 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit31.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit31.C @@ -1,5 +1,6 @@ // Build don't run: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template struct S { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C index c9282632aa1..e39a27bc501 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit35.C @@ -1,5 +1,6 @@ // Build don't run: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w struct S { template diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C index 1ee7751b555..a56c213d0a9 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C @@ -1,5 +1,6 @@ // Build don't run: // GROUPS passed templates +// Special g++ Options: -ansi -pedantic-errors -w template int foo(T t); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C b/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C index 1a5cabe67a1..d356a4ed55a 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/memclass7.C @@ -1,3 +1,4 @@ +// Special g++ Options: -ansi -pedantic-errors -w struct S { template diff --git a/gcc/testsuite/g++.old-deja/g++.warn/impint.C b/gcc/testsuite/g++.old-deja/g++.warn/impint.C new file mode 100644 index 00000000000..b253f3f2251 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.warn/impint.C @@ -0,0 +1,57 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 24 Feb 2000 + +// derived from a bug report by Johan Kuipers +// initialization to 'int' from to 'double' We expect consistent warnings +// whenever a float is implicitly truncated to int + +struct X +{ + X (int); + X (int, int); +}; + +void foo (int); +void wibble (int); +void wibble (int, int); +void punk (int = 3.5); +void rock (); +void rock (int, int = 3.5); + +void fn () +{ + X x1(3.5); // WARNING - double to int + X x2(3.5f); // WARNING - float to int + X x3(1, 3.5); // WARNING - double to int + X x4(1, 3.5f); // WARNING - float to int + X x5(3.5, 1); // WARNING - double to int + X x6(3.5f, 1); // WARNING - float to int + + X y1 = 3.5; // WARNING - double to int + X y2 = 3.5f; // WARNING - float to int + + int j1 (3.5); // WARNING - double to int + int j2 (3.5f); // WARNING - float to int + + int k1 = 3.5; // WARNING - double to int + int k2 = 3.5f; // WARNING - float to int + + j1 = 3.5; // WARNING - double to int + j2 = 3.5f; // WARNING - float to int + + foo (3.5); // WARNING - double to int + foo (3.5f); // WARNING - float to int + + wibble (3.5); // WARNING - double to int + wibble (3.5f); // WARNING - float to int + wibble (1, 3.5); // WARNING - double to int + wibble (1, 3.5f); // WARNING - float to int + wibble (3.5, 1); // WARNING - double to int + wibble (3.5f, 1); // WARNING - float to int + + punk (); // WARNING - double to int + rock (1); // WARNING - double to int +} +