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: upstream/12.2.0~70983 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=887a780fb659d2e71fc8cd3db5ff911f15423326;p=platform%2Fupstream%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 0000000..4a80462 --- /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 (); +}