[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / warn-static-const-float.cpp
blob481a410489bb932de3a32a04f8075a4f89dcbf82
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
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
19 struct X {
20 static const double x = 0.0;