Move -Wstatic-float-init fixit into a note & don't recover as if constexpr
llvm-svn: 173841
diff --git a/clang/test/CXX/class/class.static/class.static.data/p3.cpp b/clang/test/CXX/class/class.static/class.static.data/p3.cpp
index 0d104e0..1607bac 100644
--- a/clang/test/CXX/class/class.static/class.static.data/p3.cpp
+++ b/clang/test/CXX/class/class.static/class.static.data/p3.cpp
@@ -13,7 +13,7 @@
static const int d2 = 0;
static constexpr double e = 0.0; // ok
- static const double f = 0.0; // expected-error {{requires 'constexpr' specifier}}
+ static const double f = 0.0; // expected-error {{requires 'constexpr' specifier}} expected-note {{add 'constexpr'}}
static char *const g = 0; // expected-error {{requires 'constexpr' specifier}}
static const NonLit h = NonLit(); // expected-error {{must be initialized out of line}}
};
diff --git a/clang/test/CXX/class/class.union/p2-0x.cpp b/clang/test/CXX/class/class.union/p2-0x.cpp
index 19a3ea2..5fb8a67 100644
--- a/clang/test/CXX/class/class.union/p2-0x.cpp
+++ b/clang/test/CXX/class/class.union/p2-0x.cpp
@@ -7,7 +7,7 @@
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double k4 = k2;
- static const double k5 = k4; // expected-error {{requires 'constexpr' specifier}}
+ static const double k5 = k4; // expected-error {{requires 'constexpr' specifier}} expected-note {{add 'constexpr'}}
int n[k1 + 3];
};
diff --git a/clang/test/SemaCXX/cxx0x-class.cpp b/clang/test/SemaCXX/cxx0x-class.cpp
index 4e0d5bc..074591e 100644
--- a/clang/test/SemaCXX/cxx0x-class.cpp
+++ b/clang/test/SemaCXX/cxx0x-class.cpp
@@ -20,8 +20,8 @@
float foo(); // expected-note {{here}}
struct A {
- static const float x = 5.0f; // expected-warning {{requires 'constexpr'}}
- static const float y = foo(); // expected-warning {{requires 'constexpr'}}
+ static const float x = 5.0f; // expected-warning {{requires 'constexpr'}} expected-note {{add 'constexpr'}}
+ static const float y = foo(); // expected-warning {{requires 'constexpr'}} expected-note {{add 'constexpr'}}
static constexpr float x2 = 5.0f;
static constexpr float y2 = foo(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-constexpr function 'foo'}}
};
diff --git a/clang/test/SemaCXX/warn-static-const-float.cpp b/clang/test/SemaCXX/warn-static-const-float.cpp
index a669c85..481a410 100644
--- a/clang/test/SemaCXX/warn-static-const-float.cpp
+++ b/clang/test/SemaCXX/warn-static-const-float.cpp
@@ -10,9 +10,10 @@
#if NONE
// expected-no-diagnostics
#elif ERR
-// expected-error@19 {{in-class initializer for static data member of type 'const double' requires 'constexpr' specifier}}
+// expected-error@20 {{in-class initializer for static data member of type 'const double' requires 'constexpr' specifier}}
+// expected-note@20 {{add 'constexpr'}}
#elif EXT
-// expected-warning@19 {{in-class initializer for static data member of type 'const double' is a GNU extension}}
+// expected-warning@20 {{in-class initializer for static data member of type 'const double' is a GNU extension}}
#endif
struct X {