OSDN Git Service

PR c++/11554
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Dec 2003 06:07:01 +0000 (06:07 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Dec 2003 06:07:01 +0000 (06:07 +0000)
* init.c (sort_mem_initializers): Add warning.

PR c++/11554
* testsuite/g++.dg/warn/ctor-init-1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74926 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/ctor-init-1.C [new file with mode: 0644]

index 48758f6..3a70d2e 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-21  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/11554
+       * init.c (sort_mem_initializers): Add warning.
+
 2003-12-21  Kazu Hirata  <kazu@cs.umass.edu>
 
        * call.c: Fix comment formatting.
index 0b1b66c..f717fb2 100644 (file)
@@ -514,6 +514,7 @@ sort_mem_initializers (tree t, tree mem_inits)
            cp_warning_at ("  `%#D'", subobject);
          else
            warning ("  base `%T'", subobject);
+         warning ("  when initialized here");
        }
 
       /* Look again, from the beginning of the list.  */
index 563446a..46d665b 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-21  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/11554
+       * testsuite/g++.dg/warn/ctor-init-1.C: New test.
+
 2003-12-21  Kazu Hirata  <kazu@cs.umass.edu>
 
        * gcc.c-torture/compile/20020910-1.c: Disable if __INT_MAX is
diff --git a/gcc/testsuite/g++.dg/warn/ctor-init-1.C b/gcc/testsuite/g++.dg/warn/ctor-init-1.C
new file mode 100644 (file)
index 0000000..0796972
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/11554
+// { dg-options "-Wall" }
+
+struct Y {
+  Y ();
+  int i1, i2; // { dg-warning "" }
+};
+
+Y::Y () : i2(0), i1(0) {} // { dg-warning "" }