OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-noexcept4.C
1 // { dg-options -std=c++0x }
2 // A call is noexcept if it is a valid subexpression of a constant
3 // expression, even if it is not itself a constant expression.
4
5 #define SA(X) static_assert(X,#X)
6
7 constexpr const int* f(const int *p) { return p; }
8
9 int main()
10 {
11   constexpr int i = 42;
12   SA(noexcept(*f(&i)));
13   SA(noexcept(f(&i)));
14 }