Richard Smith | b4b1d69 | 2013-01-25 04:22:16 +0000 | [diff] [blame] | 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 |
David Blaikie | a367e9d | 2013-01-29 22:26:08 +0000 | [diff] [blame] | 13 | // expected-error@20 {{in-class initializer for static data member of type 'const double' requires 'constexpr' specifier}} |
| 14 | // expected-note@20 {{add 'constexpr'}} |
Richard Smith | b4b1d69 | 2013-01-25 04:22:16 +0000 | [diff] [blame] | 15 | #elif EXT |
David Blaikie | a367e9d | 2013-01-29 22:26:08 +0000 | [diff] [blame] | 16 | // expected-warning@20 {{in-class initializer for static data member of type 'const double' is a GNU extension}} |
Richard Smith | b4b1d69 | 2013-01-25 04:22:16 +0000 | [diff] [blame] | 17 | #endif |
| 18 | |
| 19 | struct X { |
| 20 | static const double x = 0.0; |
| 21 | }; |