]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Mon, 29 Dec 2003 05:32:32 +0000 (05:32 +0000)
committerNo Author <no-author@gcc.gnu.org>
Mon, 29 Dec 2003 05:32:32 +0000 (05:32 +0000)
'gcc-3_3-branch'.

From-SVN: r75193

gcc/testsuite/g++.dg/init/assign1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/opt/inline6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/format3.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/init/assign1.C b/gcc/testsuite/g++.dg/init/assign1.C
new file mode 100644 (file)
index 0000000..690a481
--- /dev/null
@@ -0,0 +1,30 @@
+// PR c++/13009
+// { dg-do run }
+
+struct A {
+  char a;
+};
+
+struct B: public virtual A {
+  #if 0 // this piece of code works around the problem
+  B& operator= (const B& other)
+  {
+    A::operator= (other);
+  }
+  #endif
+};
+
+struct C: public B {
+  char c;
+};
+
+int main() {
+  B b;
+  b.a = 'b';
+  C c;
+  c.a = c.c = 'c';
+  
+  c.B::operator= (b);
+  if (c.a != 'b' || c.c != 'c')
+    return 1;
+}
diff --git a/gcc/testsuite/g++.dg/opt/inline6.C b/gcc/testsuite/g++.dg/opt/inline6.C
new file mode 100644 (file)
index 0000000..2187221
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/13081
+// { dg-options "-O2" }
+// { dg-final { scan-assembler-not "foo" } }
+
+template<typename T> T foo(T);
+template<typename T> inline T foo(T t)
+{
+  return t;
+}
+
+void bar (long& l) {
+  l = foo(l);
+}
diff --git a/gcc/testsuite/g++.dg/warn/format3.C b/gcc/testsuite/g++.dg/warn/format3.C
new file mode 100644 (file)
index 0000000..0bdaaee
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/13070
+// { dg-do compile }
+// { dg-options "-Wformat" }
+
+extern "C" int printf (const char*, ...);
+
+int main()
+{
+  printf("%d\n", 1, 1);  // { dg-warning "too many" "printf warning" }
+  return 0;
+}
+