diff options
Diffstat (limited to 'test/SemaCXX/PR9572.cpp')
-rw-r--r-- | test/SemaCXX/PR9572.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/PR9572.cpp b/test/SemaCXX/PR9572.cpp new file mode 100644 index 0000000..d1b7077 --- /dev/null +++ b/test/SemaCXX/PR9572.cpp @@ -0,0 +1,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() { } +}; |