Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / class / class.static / class.static.data / p4.cpp
blob85d18c6b5fac23d5bb29c27affd6ac1b3b941524
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 struct InClassInitializerOnly {
3 static const int i = 0;
4 };
5 int const InClassInitializerOnly::i;
7 struct OutOfClassInitializerOnly {
8 static const int i;
9 };
10 int const OutOfClassInitializerOnly::i = 0;
12 struct InClassInitializerAndOutOfClassCopyInitializer {
13 static const int i = 0; // expected-note{{previous initialization is here}}
15 int const InClassInitializerAndOutOfClassCopyInitializer::i = 0; // expected-error{{static data member 'i' already has an initializer}}
17 struct InClassInitializerAndOutOfClassDirectInitializer {
18 static const int i = 0; // expected-note{{previous initialization is here}}
20 int const InClassInitializerAndOutOfClassDirectInitializer::i(0); // expected-error{{static data member 'i' already has an initializer}}
23 int main() { }