This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] libstdc++/64367 fix __sso_string to compile with clang


The same file has another instance of the same problem (which compiles
with G++ in all modes, but Clang rejects in c++98 mode).

Tested x86_64-linux, committed to trunk.
commit 7cf52d6430d73c412f5205098c6cfe0ce7a3d0d5
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Feb 26 13:31:48 2015 +0000

    	PR libstdc++/64367
    	* include/std/stdexcept (__sso_string): Don't use non-static member
    	in sizeof.

diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept
index bf3e618..2428919 100644
--- a/libstdc++-v3/include/std/stdexcept
+++ b/libstdc++-v3/include/std/stdexcept
@@ -80,7 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     union {
       __str _M_s;
-      char _M_bytes[sizeof(_M_s)];
+      char _M_bytes[sizeof(__str)];
     };
 
     __sso_string() _GLIBCXX_USE_NOEXCEPT;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]