blob: 481a410489bb932de3a32a04f8075a4f89dcbf82 [file] [log] [blame]
Richard Smithb4b1d692013-01-25 04:22:16 +00001// RUN: %clang_cc1 -verify %s -std=c++98 -DEXT
2// RUN: %clang_cc1 -verify %s -std=c++98 -Wno-gnu -DNONE
3// RUN: %clang_cc1 -verify %s -std=c++98 -Wno-static-float-init -DNONE
4// RUN: %clang_cc1 -verify %s -std=c++98 -Wno-gnu-static-float-init -DNONE
5// RUN: %clang_cc1 -verify %s -std=c++11 -DERR
6// RUN: %clang_cc1 -verify %s -std=c++11 -Wno-gnu -DERR
7// RUN: %clang_cc1 -verify %s -std=c++11 -Wno-static-float-init -DNONE
8// RUN: %clang_cc1 -verify %s -std=c++11 -Wno-gnu-static-float-init -DERR
9
10#if NONE
11// expected-no-diagnostics
12#elif ERR
David Blaikiea367e9d2013-01-29 22:26:08 +000013// expected-error@20 {{in-class initializer for static data member of type 'const double' requires 'constexpr' specifier}}
14// expected-note@20 {{add 'constexpr'}}
Richard Smithb4b1d692013-01-25 04:22:16 +000015#elif EXT
David Blaikiea367e9d2013-01-29 22:26:08 +000016// expected-warning@20 {{in-class initializer for static data member of type 'const double' is a GNU extension}}
Richard Smithb4b1d692013-01-25 04:22:16 +000017#endif
18
19struct X {
20 static const double x = 0.0;
21};