summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/PR9572.cpp
blob: d1b70778d06286bae91e035537156f1dfec69e93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: %clang_cc1 -fsyntax-only -verify %s
class Base {
  virtual ~Base();
};
struct Foo : public Base {
  const int kBlah = 3; // expected-error{{fields can only be initialized in constructors}}
  Foo();
};
struct Bar : public Foo {
  Bar() { }
};
struct Baz {
  Foo f;
  Baz() { }
};
OpenPOWER on IntegriCloud