view gcc/testsuite/g++.old-deja/g++.robertl/eb132.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { 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";
}