[libcxx-commits] [PATCH] D117157: [libc++][NFC] Remove clang-diagnostic-c++98-compat-extra-semi warnings in experimental/simd

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 12 14:15:18 PST 2022


philnik created this revision.
philnik added reviewers: Quuxplusone, ldionne, Mordante.
Herald added a subscriber: miyuki.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Force semicolons or remove them in `experimental/simd`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117157

Files:
  libcxx/include/__config
  libcxx/include/experimental/simd


Index: libcxx/include/experimental/simd
===================================================================
--- libcxx/include/experimental/simd
+++ libcxx/include/experimental/simd
@@ -689,7 +689,7 @@
   friend struct simd_mask;
 
 public:
-  _Tp __get(size_t __index) const noexcept { return __storage_[__index]; };
+  _Tp __get(size_t __index) const noexcept { return __storage_[__index]; }
   void __set(size_t __index, _Tp __val) noexcept {
     __storage_[__index] = __val;
   }
@@ -706,7 +706,7 @@
   friend struct simd_mask;
 
 public:
-  _Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; };
+  _Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; }
   void __set(size_t __index, _Tp __val) noexcept {
     (&__storage_)[__index] = __val;
   }
@@ -770,7 +770,7 @@
   _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 29);                                       \
   _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 30);                                       \
   _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 31);                                       \
-  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 32);
+  _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 32); _LIBCPP_FORCE_SEMICOLON
 
 _LIBCPP_SPECIALIZE_VEC_EXT_32(char);
 _LIBCPP_SPECIALIZE_VEC_EXT_32(char16_t);
@@ -808,7 +808,7 @@
   friend struct simd_mask;
 
 public:
-  _Tp __get(size_t __index) const noexcept { return __storage_[__index]; };
+  _Tp __get(size_t __index) const noexcept { return __storage_[__index]; }
   void __set(size_t __index, _Tp __val) noexcept {
     __storage_[__index] = __val;
   }
Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -1425,6 +1425,8 @@
 # define _LIBCPP_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) /* nothing */
 #endif
 
+#define _LIBCPP_FORCE_SEMICOLON static_assert(true)
+
 #endif // __cplusplus
 
 #endif // _LIBCPP_CONFIG


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117157.399463.patch
Type: text/x-patch
Size: 1954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220112/6620e789/attachment.bin>


More information about the libcxx-commits mailing list