Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.robertl/eb132.C

raw
1 // { dg-do assemble }
2 // { dg-options "-O -Wall -fgcse" }
3 // { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } }
4 // From: Klaus-Georg Adams <[email protected]>
5 // Reported against EGCS snaps 98/06/28.
6 //
7 // Compilation of this program with the flags g++ -Wall -O -fgcse
8 // or -O2 produces spurious warnings in the standard
9 // header <std/bastring.h>.
10 //
11 // They vanish if the declaration of a::b is taken out.
12
13 #include <string>
14
15 std::string foo();
16 struct a {
17 void bar();
18 enum b { c, d };
19 b theb;
20 std::string baz;
21 };
22
23 void
24 a::bar()
25 {
26 baz += foo() + foo();
27 baz += foo() + foo() + "foo";
28 }
29