Found the following error when running "make check" in a x86 machine running Ubuntu 11.10:
...
g++ -DHAVE_CONFIG_H -I. -I../../../oprofile.git/libutil++/tests -I../.. -I ../../../oprofile.git/libutil++ -D SRCDIR="\"/home/emachado/devel/oprofile/build/libutil++/tests/\"" -W -Wall -fno-common -ftemplate-depth-50 -Werror -g -O2 -MT cached_value_tests.o -MD -MP -MF .deps/cached_value_tests.Tpo -c -o cached_value_tests.o ../../../oprofile.git/libutil++/tests/cached_value_tests.cpp
../../../oprofile.git/libutil++/tests/cached_value_tests.cpp: In function ‘bool {anonymous}::check_throw(const cached_value<bool>&)’:
../../../oprofile.git/libutil++/tests/cached_value_tests.cpp:25:8: error: variable ‘foo’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
make[3]: *** [cached_value_tests.o] Error 1
make[3]: Leaving directory `/home/emachado/devel/oprofile/build/libutil++/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/emachado/devel/oprofile/build/libutil++/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/emachado/devel/oprofile/build/libutil++'
make: *** [check-recursive] Error 1
Edjunior, please test the attached patch.
Patch to fix this bug
I found a system with gcc 4.7.1 with which I could reproduce this error. The attached patch fixes the problem, so I'm marking this bug as "Fixed" and will commit the patch upstream.