1 | // 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 |
13 | // expected-error@20 {{in-class initializer for static data member of type 'const double' requires 'constexpr' specifier}} |
14 | // expected-note@20 {{add 'constexpr'}} |
15 | #elif EXT |
16 | // expected-warning@20 {{in-class initializer for static data member of type 'const double' is a GNU extension}} |
17 | #endif |
18 | |
19 | struct X { |
20 | static const double x = 0.0; |
21 | }; |
22 | |