view gcc/testsuite/g++.dg/cpp0x/constexpr-deref.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// { dg-do compile { target c++11 } }

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
}