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

extern int *p;
constexpr int& ri = *p;		// { dg-error "p" }

extern constexpr int &er;	// { dg-error "not a definition" }
constexpr int& ri2 = er;	// { dg-error "er" }

void f(int j)
{
  constexpr int i = 42;
  constexpr int const& ri = i;	// { dg-error "" }

  constexpr int& rj = j;	// { dg-error "" }
}