llvm-project/clang/test/SemaCXX/PR9572.cpp

16 lines
287 B
C++

// 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() { }
};