summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.robertl/eb132.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb132.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C
new file mode 100644
index 000000000..e5992aa66
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+// { dg-options "-O -Wall -fgcse" }
+// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
+// Reported against EGCS snaps 98/06/28.
+//
+// Compilation of this program with the flags g++ -Wall -O -fgcse
+// or -O2 produces spurious warnings in the standard
+// header <std/bastring.h>.
+//
+// They vanish if the declaration of a::b is taken out.
+
+#include <string>
+
+std::string foo();
+struct a {
+ void bar();
+ enum b { c, d };
+ b theb;
+ std::string baz;
+};
+
+void
+a::bar()
+{
+ baz += foo() + foo();
+ baz += foo() + foo() + "foo";
+}
+