OSDN Git Service

2012-12-15 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / initlist-opt.C
1 // PR c++/41997
2 // { dg-options "-std=c++0x -O2 -fdump-tree-optimized" }
3 // { dg-final { scan-tree-dump-not "_0" "optimized" } }
4 // { dg-final { cleanup-tree-dump "optimized" } }
5
6 #include <initializer_list>
7
8 inline int max_val(std::initializer_list<int> il)
9 {
10         int i = *(il.begin());
11         int j = *(il.begin() + 1);
12         return (i > j ? i : j);
13 }
14
15 int main(void)
16 {
17         return max_val({1,2});
18 }
19