impint.C: New test.
authorNathan Sidwell <nathan@codesourcery.com>
Sun, 5 Mar 2000 10:23:46 +0000 (10:23 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Sun, 5 Mar 2000 10:23:46 +0000 (10:23 +0000)
* 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

14 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C
gcc/testsuite/g++.old-deja/g++.pt/explicit10.C
gcc/testsuite/g++.old-deja/g++.pt/explicit12.C
gcc/testsuite/g++.old-deja/g++.pt/explicit13.C
gcc/testsuite/g++.old-deja/g++.pt/explicit17.C
gcc/testsuite/g++.old-deja/g++.pt/explicit18.C
gcc/testsuite/g++.old-deja/g++.pt/explicit19.C
gcc/testsuite/g++.old-deja/g++.pt/explicit23.C
gcc/testsuite/g++.old-deja/g++.pt/explicit31.C
gcc/testsuite/g++.old-deja/g++.pt/explicit35.C
gcc/testsuite/g++.old-deja/g++.pt/explicit6.C
gcc/testsuite/g++.old-deja/g++.pt/memclass7.C
gcc/testsuite/g++.old-deja/g++.warn/impint.C [new file with mode: 0644]

index f51ec94..b13fcbc 100644 (file)
@@ -1,3 +1,19 @@
+2000-03-05  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * 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  <zack@wolery.cumb.org>
 
        * gcc.dg/cpp-redef.c: New test.
index 56f7a1c..f470157 100644 (file)
@@ -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
index d90b8d0..7f38f72 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't link:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 template <class T>
 void foo(T t);
 
index 0defb19..820da3d 100644 (file)
@@ -1,4 +1,5 @@
 // Build don't run:
+// Special g++ Options: -ansi -pedantic-errors -w
 // GROUPS passed templates
 template <class U>
 struct S 
index fbb7901..9391586 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't run:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 
 template <class U>
 struct S 
index 8e8688d..4abd17e 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't link:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 template <class T, class U>
 void foo(U u, T t);
 
index 20c4b75..b63fc3f 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't run:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 template <class T>
 int foo(T t) { return 0; }
 
index b209bbe..3b29403 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't run:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 template <class T>
 int foo(T t);
 
index cdffb15..85fab00 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't run:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 template <class T>
 int foo(T t) { return 1; }
 
index 61190f7..900ba11 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't run:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 template <class T>
 struct S
 {
index c928263..e39a27b 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't run:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 struct S 
 {
   template <class T>
index 1ee7751..a56c213 100644 (file)
@@ -1,5 +1,6 @@
 // Build don't run:
 // GROUPS passed templates
+// Special g++ Options: -ansi -pedantic-errors -w
 template <class T>
 int foo(T t);
 
index 1a5cabe..d356a4e 100644 (file)
@@ -1,3 +1,4 @@
+// Special g++ Options: -ansi -pedantic-errors -w
 struct S 
 {
   template <class U>
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 (file)
index 0000000..b253f3f
--- /dev/null
@@ -0,0 +1,57 @@
+// Build don't link:
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Feb 2000 <nathan@codesourcery.com>
+
+// derived from a bug report by Johan Kuipers <j.kuipers@chello.nl>
+// 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
+}
+