From: Jason Merrill Date: Tue, 5 Mar 2013 18:58:36 +0000 (-0500) Subject: re PR c++/50276 ([C++0x] Wrong "used uninitialized in this function" warning) X-Git-Tag: releases/gcc-4.8.0~179 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=887a780fb659d2e71fc8cd3db5ff911f15423326;p=thirdparty%2Fgcc.git re PR c++/50276 ([C++0x] Wrong "used uninitialized in this function" warning) PR c++/50276 * g++.dg/cpp0x/lambda/lambda-template10.C: New. From-SVN: r196472 --- diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template10.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template10.C new file mode 100644 index 000000000000..4a804628728d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template10.C @@ -0,0 +1,23 @@ +// PR c++/50276 +// { dg-options "-std=c++11 -Wuninitialized" } +// { dg-do run } + +template +unsigned testfun(const T& func) +{ + return func(); +} + +template +unsigned test() +{ + if (unsigned value = testfun( [] () { return 0; })) + return value; + return i; +} + +int main() +{ + if (test<42>() != 42) + __builtin_abort (); +}