public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] libstdc++/64367 fix __sso_string to compile with clang
@ 2014-12-21 15:57 Jonathan Wakely
  2015-03-02 16:50 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2014-12-21 15:57 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 46 bytes --]

Tested powerpc64-linux, committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 628 bytes --]

commit 922a84d1db99455f6d8900453ea5615f93b124f1
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sun Dec 21 13:54:39 2014 +0000

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

diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept
index c927f05..e049a6e 100644
--- a/libstdc++-v3/include/std/stdexcept
+++ b/libstdc++-v3/include/std/stdexcept
@@ -49,7 +49,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   {
     union {
       const char* _M_p;
-      char _M_bytes[sizeof(_M_p)];
+      char _M_bytes[sizeof(const char*)];
     };
 
     __cow_string();

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] libstdc++/64367 fix __sso_string to compile with clang
  2014-12-21 15:57 [patch] libstdc++/64367 fix __sso_string to compile with clang Jonathan Wakely
@ 2015-03-02 16:50 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2015-03-02 16:50 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

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.

[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 655 bytes --]

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-02 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-21 15:57 [patch] libstdc++/64367 fix __sso_string to compile with clang Jonathan Wakely
2015-03-02 16:50 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).