public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix two C++ errors in libstdc++. (issue4341041)
@ 2011-03-31 19:06 Jeffrey Yasskin
  2011-03-31 19:49 ` Paolo Carlini
  0 siblings, 1 reply; 8+ messages in thread
From: Jeffrey Yasskin @ 2011-03-31 19:06 UTC (permalink / raw)
  To: reply, gcc-patches

I think this is a candidate to backport to libstdc++-4.6.1.

exception_ptr.h needs the forward declaration because it's
included from <typeinfo> before <typeinfo> defines std::type_info.

Tested:
  `make check` in x86_64-unknown-linux-gnu/libstdc++-v3.  The
  abi_check test fails, but also did before this change.

libstdc++-v3/ChangeLog:

2011-03-31  Jeffrey Yasskin  <jyasskin@google.com>

	* libsupc++/exception_ptr.h: Forward-declare std::type_info.
	* libsupc++/nested_exception.h (__throw_with_nested): Remove a
	redundant default argument from std::__throw_with_nested.

diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
index ef826f6..26117cd 100644
--- a/libstdc++-v3/libsupc++/exception_ptr.h
+++ b/libstdc++-v3/libsupc++/exception_ptr.h
@@ -137,7 +137,7 @@ namespace std
       operator==(const exception_ptr&, const exception_ptr&) throw() 
       __attribute__ ((__pure__));
 
-      const type_info*
+      const class type_info*
       __cxa_exception_type() const throw() __attribute__ ((__pure__));
     };
 
diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h
index 6a4f04e..d4804bb 100644
--- a/libstdc++-v3/libsupc++/nested_exception.h
+++ b/libstdc++-v3/libsupc++/nested_exception.h
@@ -117,7 +117,7 @@ namespace std
   // with a type that has an accessible nested_exception base.
   template<typename _Ex>
     inline void
-    __throw_with_nested(_Ex&& __ex, const nested_exception* = 0)
+    __throw_with_nested(_Ex&& __ex, const nested_exception*)
     { throw __ex; }
 
   template<typename _Ex>

--
This patch is available for review at http://codereview.appspot.com/4341041

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

* Re: [patch] Fix two C++ errors in libstdc++. (issue4341041)
  2011-03-31 19:06 [patch] Fix two C++ errors in libstdc++. (issue4341041) Jeffrey Yasskin
@ 2011-03-31 19:49 ` Paolo Carlini
  2011-03-31 20:02   ` Paolo Carlini
  2011-03-31 21:26   ` Jason Merrill
  0 siblings, 2 replies; 8+ messages in thread
From: Paolo Carlini @ 2011-03-31 19:49 UTC (permalink / raw)
  To: jyasskin; +Cc: reply, gcc-patches, Jason Merrill

Hi,
> I think this is a candidate to backport to libstdc++-4.6.1.
>
> exception_ptr.h needs the forward declaration because it's
> included from<typeinfo>  before<typeinfo>  defines std::type_info.
before going ahead with the patch - I'm not at all sure it's enough, for 
<exception> itself for example - I think we should understand why this 
is accepted, note no headers:

namespace std
{
   struct test
   {
     const type_info* fun();
   };
}

Jason?

Paolo.

PS: remember to always post libstdc++ patches to the libstdc++ mailing 
list too

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

* Re: [patch] Fix two C++ errors in libstdc++. (issue4341041)
  2011-03-31 19:49 ` Paolo Carlini
@ 2011-03-31 20:02   ` Paolo Carlini
  2011-03-31 21:34     ` Jeffrey Yasskin
  2011-03-31 21:26   ` Jason Merrill
  1 sibling, 1 reply; 8+ messages in thread
From: Paolo Carlini @ 2011-03-31 20:02 UTC (permalink / raw)
  To: jyasskin; +Cc: reply, gcc-patches, Jason Merrill

On 03/31/2011 09:41 PM, Paolo Carlini wrote:
>> I think this is a candidate to backport to libstdc++-4.6.1.
>>
>> exception_ptr.h needs the forward declaration because it's
>> included from<typeinfo>  before<typeinfo>  defines std::type_info.
> before going ahead with the patch - I'm not at all sure it's enough, 
> for <exception> itself for example
I had a closer look to what we have and indeed the patch seems enough to 
solve the existing issues. Thanks. I think we want indeed to apply the 
patchlet to mainline and 4_6-branch, but my basic puzzlement stays, 
indeed it's the real reason why the problem remained unnoticed for so 
much time!

Paolo.

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

* Re: [patch] Fix two C++ errors in libstdc++. (issue4341041)
  2011-03-31 19:49 ` Paolo Carlini
  2011-03-31 20:02   ` Paolo Carlini
@ 2011-03-31 21:26   ` Jason Merrill
  2011-03-31 21:28     ` Paolo Carlini
  1 sibling, 1 reply; 8+ messages in thread
From: Jason Merrill @ 2011-03-31 21:26 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: jyasskin, reply, gcc-patches

On 03/31/2011 03:41 PM, Paolo Carlini wrote:
> I think we should understand why this
> is accepted, note no headers:
>
> namespace std
> {
>   struct test
>   {
>     const type_info* fun();
>   };
> }
>
> Jason?

Compiler bug.

Jason

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

* Re: [patch] Fix two C++ errors in libstdc++. (issue4341041)
  2011-03-31 21:26   ` Jason Merrill
@ 2011-03-31 21:28     ` Paolo Carlini
  2011-03-31 21:39       ` Jason Merrill
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Carlini @ 2011-03-31 21:28 UTC (permalink / raw)
  To: Jason Merrill; +Cc: jyasskin, reply, gcc-patches

Hi,
> 
> Compiler bug.

Agreed. Thus, I'm going to apply the library patch, release branch too, seems safe, even if I don't think the compiler bug is likely to be fixed in the branch too... Jason let me know if you want a Bugzilla or the issue is basically known.

Paolo

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

* Re: [patch] Fix two C++ errors in libstdc++. (issue4341041)
  2011-03-31 20:02   ` Paolo Carlini
@ 2011-03-31 21:34     ` Jeffrey Yasskin
  2011-03-31 22:10       ` Paolo Carlini
  0 siblings, 1 reply; 8+ messages in thread
From: Jeffrey Yasskin @ 2011-03-31 21:34 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: reply, gcc-patches, Jason Merrill, libstdc++

On Thu, Mar 31, 2011 at 12:49 PM, Paolo Carlini
<paolo.carlini@oracle.com> wrote:
> On 03/31/2011 09:41 PM, Paolo Carlini wrote:
>>>
>>> I think this is a candidate to backport to libstdc++-4.6.1.
>>>
>>> exception_ptr.h needs the forward declaration because it's
>>> included from<typeinfo>  before<typeinfo>  defines std::type_info.
>>
>> before going ahead with the patch - I'm not at all sure it's enough, for
>> <exception> itself for example
>
> I had a closer look to what we have and indeed the patch seems enough to
> solve the existing issues. Thanks. I think we want indeed to apply the
> patchlet to mainline and 4_6-branch, but my basic puzzlement stays, indeed
> it's the real reason why the problem remained unnoticed for so much time!

Thanks. Is that an OK that I can commit this to mainline and 4_6-branch?

[For libstdc++@ people, the patch is at
http://codereview.appspot.com/4341041 and
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg02261.html]

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

* Re: [patch] Fix two C++ errors in libstdc++. (issue4341041)
  2011-03-31 21:28     ` Paolo Carlini
@ 2011-03-31 21:39       ` Jason Merrill
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Merrill @ 2011-03-31 21:39 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: jyasskin, reply, gcc-patches

On 03/31/2011 05:25 PM, Paolo Carlini wrote:
> Jason let me know if you want a Bugzilla

Please.

Jason

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

* Re: [patch] Fix two C++ errors in libstdc++. (issue4341041)
  2011-03-31 21:34     ` Jeffrey Yasskin
@ 2011-03-31 22:10       ` Paolo Carlini
  0 siblings, 0 replies; 8+ messages in thread
From: Paolo Carlini @ 2011-03-31 22:10 UTC (permalink / raw)
  To: Jeffrey Yasskin; +Cc: reply, gcc-patches, Jason Merrill, libstdc++

Hi,

> Thanks. Is that an OK that I can commit this to mainline and 4_6-branch?

Sure, if you are ready to commit please go ahead, thanks. Note that the C++ front end issue is also important, the next time you encounter something similar please point it out explicitly!

Thanks,
Paolo

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

end of thread, other threads:[~2011-03-31 21:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31 19:06 [patch] Fix two C++ errors in libstdc++. (issue4341041) Jeffrey Yasskin
2011-03-31 19:49 ` Paolo Carlini
2011-03-31 20:02   ` Paolo Carlini
2011-03-31 21:34     ` Jeffrey Yasskin
2011-03-31 22:10       ` Paolo Carlini
2011-03-31 21:26   ` Jason Merrill
2011-03-31 21:28     ` Paolo Carlini
2011-03-31 21:39       ` Jason Merrill

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).