22 lines · cpp
1// RUN: %clang_cc1 -verify %s -std=c++98 -DEXT2// RUN: %clang_cc1 -verify %s -std=c++98 -Wno-gnu -DNONE3// RUN: %clang_cc1 -verify %s -std=c++98 -Wno-static-float-init -DNONE4// RUN: %clang_cc1 -verify %s -std=c++98 -Wno-gnu-static-float-init -DNONE5// RUN: %clang_cc1 -verify %s -std=c++11 -DERR6// RUN: %clang_cc1 -verify %s -std=c++11 -Wno-gnu -DERR7// RUN: %clang_cc1 -verify %s -std=c++11 -Wno-static-float-init -DNONE8// RUN: %clang_cc1 -verify %s -std=c++11 -Wno-gnu-static-float-init -DERR9 10#if NONE11// expected-no-diagnostics12#elif ERR13// 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 EXT16// expected-warning@20 {{in-class initializer for static data member of type 'const double' is a GNU extension}}17#endif18 19struct X {20 static const double x = 0.0;21};22