PR libstdc++/85930 fix misplaced alignment-specifier
authorJonathan Wakely <jwakely@redhat.com>
Mon, 4 Jun 2018 21:38:42 +0000 (22:38 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 4 Jun 2018 21:38:42 +0000 (22:38 +0100)
PR libstdc++/85930
* include/bits/shared_ptr_base.h [!__cpp_rtti]: Include <typeinfo>
unconditionally. Remove redundant declaration.
[!__cpp_rtti] (_Sp_make_shared_tag::_S_ti): Fix location of
alignment-specifier.

From-SVN: r261172

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/shared_ptr_base.h

index ebfdd36..2a201ae 100644 (file)
@@ -1,5 +1,11 @@
 2018-06-04  Jonathan Wakely  <jwakely@redhat.com>
 
+       PR libstdc++/85930
+       * include/bits/shared_ptr_base.h [!__cpp_rtti]: Include <typeinfo>
+       unconditionally. Remove redundant declaration.
+       [!__cpp_rtti] (_Sp_make_shared_tag::_S_ti): Fix location of
+       alignment-specifier.
+
        * include/bits/postypes.h (fpos): Define special members as defaulted.
 
        PR libstdc++/85930
index 22cb7eb..6c5089a 100644 (file)
@@ -49,9 +49,7 @@
 #ifndef _SHARED_PTR_BASE_H
 #define _SHARED_PTR_BASE_H 1
 
-#if __cpp_rtti
-# include <typeinfo>
-#endif
+#include <typeinfo>
 #include <bits/allocated_ptr.h>
 #include <bits/refwrap.h>
 #include <bits/stl_function.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
-#if !__cpp_rtti
-  class type_info;
-#endif
-
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #if _GLIBCXX_USE_DEPRECATED
@@ -516,7 +510,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     static const type_info&
     _S_ti() noexcept
     {
-      static constexpr alignas(type_info) _Sp_make_shared_tag __tag;
+      alignas(type_info) static constexpr _Sp_make_shared_tag __tag;
       return reinterpret_cast<const type_info&>(__tag);
     }
 #endif