summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-deref.C
blob: 7363e98ecb8f94cc2328bac77de01306f9f3398f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// { dg-options -std=c++0x }

struct A
{
  const int *p[2];
};

constexpr const int * f(const int *p) { return p; }

int main()
{
  constexpr int i = 42;
  constexpr int j = *&i;	   // OK
  constexpr int k = *A{{&i}}.p[0]; // OK
  constexpr int l = *f(&i);	   // OK
}