libstdc++: Tweak two links in configuration docs
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / array-temp1.C
blob97c2e0521c9ce835b4594f3da8c9d0fcdfb2701d
1 // PR c++/85873
2 // Test that these array temporaries are promoted to static variables as an
3 // optimization.
5 // { dg-do compile { target c++11 } }
6 // { dg-additional-options -fdump-tree-gimple }
7 // { dg-final { scan-tree-dump-not "= 42" "gimple" } }
9 #include <initializer_list>
11 int f()
13   using AR = const int[];
14   return AR{ 1,42,3,4,5,6,7,8,9,0 }[5];
17 int g()
19   std::initializer_list<int> a = {1,42,3};
20   return a.begin()[0];