Matt Beaumont-Gay | 3334b0b | 2011-03-28 01:39:13 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
2 | class Base { | ||||
3 | virtual ~Base(); | ||||
4 | }; | ||||
5 | struct Foo : public Base { | ||||
6 | const int kBlah = 3; // expected-error{{fields can only be initialized in constructors}} | ||||
7 | Foo(); | ||||
8 | }; | ||||
9 | struct Bar : public Foo { | ||||
10 | Bar() { } | ||||
11 | }; | ||||
12 | struct Baz { | ||||
13 | Foo f; | ||||
14 | Baz() { } | ||||
15 | }; |