summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse/crash56.C
blob: 9a370cb5fcdee4a551082630a5428e395fd37239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR c++/43081 */
/* { dg-do compile } */
/* { dg-options "-std=c++0x" } */

struct A
{
  typedef void (F)();
  F f = []{}; /* { dg-error "invalid initializer" } */
};

struct B
{
  typedef void (F)();
  F f = 1; /* { dg-error "invalid initializer" } */
  virtual F f2 = 2; /* { dg-error "invalid initializer" } */
  F f3 = 3; /* { dg-error "invalid initializer" } */
};