summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb132.C
blob: 5b6bc6a5842b828b7e73f362ca72d98ae080d809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Build don't link:
// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> 
// Reported against EGCS snaps 98/06/28.
// Special g++ Options: -O -Wall  -fgcse -frerun-loop-opt
//
// Compilation of this program with the flags g++ -Wall -O -fgcse
// -frerun-loop-opt 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>

string foo();
struct a {
	void bar();
	enum b { c, d };
	b theb;
	string baz;
};

void
a::bar()
{
	baz += foo() + foo();
	baz += foo() + foo() + "foo";
}