FWIW: with a few different versions of g++ (4.1, 4.2, and 4.3) under Linux, I get no such warning.
Code:
$ cat list.cpp
#include <list>
#include <string>
using namespace std;
int main ()
{
list<string> mylist;
mylist.push_back("test");
}
$ g++
g++ g++-4.1 g++-4.2 g++-4.3
$ g++ --version
g++ (Debian 4.3.1-9) 4.3.1
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ -Wall -s -Os -O3 -fexpensive-optimizations list.cpp -o list
$ g++-4.2 -Wall -s -Os -O3 -fexpensive-optimizations list.cpp -o list
$ g++-4.1 -Wall -s -Os -O3 -fexpensive-optimizations list.cpp -o list
$