Update the array tests to not use a local type; removes warnings in C++03. NFC
authorMarshall Clow <mclow.lists@gmail.com>
Fri, 12 Oct 2018 21:24:44 +0000 (21:24 +0000)
committerMarshall Clow <mclow.lists@gmail.com>
Fri, 12 Oct 2018 21:24:44 +0000 (21:24 +0000)
llvm-svn: 344417

libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
libcxx/test/std/containers/sequences/array/begin.pass.cpp

index 7148943..593df3c 100644 (file)
 // Disable the missing braces warning for this reason.
 #include "disable_missing_braces_warning.h"
 
+struct NoDefault {
+  NoDefault(int) {}
+};
+
+
 int main()
 {
     {
@@ -55,9 +60,6 @@ int main()
       assert(pint % TEST_ALIGNOF(std::max_align_t) == 0);
     }
     {
-      struct NoDefault {
-        NoDefault(int) {}
-      };
       typedef NoDefault T;
       typedef std::array<T, 0> C;
       C c = {};
index b99bf6a..e3d9a69 100644 (file)
 // Disable the missing braces warning for this reason.
 #include "disable_missing_braces_warning.h"
 
+struct NoDefault {
+  NoDefault(int) {}
+};
+
 int main()
 {
     {
@@ -39,9 +43,6 @@ int main()
         (void)p; // to placate scan-build
     }
     {
-      struct NoDefault {
-        NoDefault(int) {}
-      };
       typedef NoDefault T;
       typedef std::array<T, 0> C;
       const C c = {};
index 282a947..1c76472 100644 (file)
 // Disable the missing braces warning for this reason.
 #include "disable_missing_braces_warning.h"
 
+struct NoDefault {
+  NoDefault(int) {}
+};
+
 
 int main()
 {
@@ -33,9 +37,6 @@ int main()
         assert(c[0] == 5.5);
     }
     {
-      struct NoDefault {
-        NoDefault(int) {}
-      };
       typedef NoDefault T;
       typedef std::array<T, 0> C;
       C c = {};