summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1y/constexpr-neg1.C
blob: ae3dcc69cf0690a07a7ddc0284330d302efb79bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile { target c++14 } }

struct A { A(); };

constexpr int f(int i) {
  static int j = i;		// { dg-error "static" }
  thread_local int l = i;	// { dg-error "thread_local" }
  goto foo;			// { dg-error "goto" }
 foo:
  asm("foo");			// { dg-error "asm" }
  int k;			// { dg-error "uninitialized" }
  A a;				// { dg-error "non-literal" }
  return i;
}

// FIXME remove
// { dg-prune-output "return" }