OSDN Git Service

1a5b45aec4828b94d86a7abadc217767041ba8eb
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb132.C
1 // { dg-do assemble  }
2 // { dg-options "-O -Wall  -fgcse -frerun-loop-opt" }
3 // From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> 
4 // Reported against EGCS snaps 98/06/28.
5 //
6 // Compilation of this program with the flags g++ -Wall -O -fgcse
7 // -frerun-loop-opt or -O2 produces spurious warnings in the standard
8 // header <std/bastring.h>.
9 //
10 // They vanish if the declaration of a::b is taken out.
11
12 #include <string>
13
14 std::string foo();
15 struct a {
16         void bar();
17         enum b { c, d };
18         b theb;
19         std::string baz;
20 };
21
22 void
23 a::bar()
24 {
25         baz += foo() + foo();
26         baz += foo() + foo() + "foo";
27 }
28