1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 struct InClassInitializerOnly
{
3 static const int i
= 0;
5 int const InClassInitializerOnly::i
;
7 struct OutOfClassInitializerOnly
{
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}}