2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / constexpr-lambda10.C
blobd13053a9c4e2a4dd8e484163501605bdbe018b63
1 // Testcase from P0170R1
2 // { dg-do compile { target c++17 } }
4 void g() {
5   const int n = 0;
6   [=] {
7     constexpr int i = n; // OK, 'n' is not odr-used and not captured here.
8     constexpr int j = *&n; // { dg-error "" } '&n' would be an odr-use of 'n'.
9   };