blob: 7997e8e2c3c6670521bbea0e3a04ec388e0ca146 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// PR c++/106649
// P2448 - Relaxing some constexpr restrictions
// { dg-do compile { target c++23 } }
// { dg-options "-Winvalid-constexpr" }
constexpr volatile int i = 10;
constexpr int
bar ()
{
return i; // { dg-warning "lvalue-to-rvalue conversion of a volatile lvalue" }
}
constexpr int x = bar (); // { dg-error "called in a constant expression" }
|