public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept
@ 2012-03-12 11:57 daniel.kruegler at googlemail dot com
  2012-03-12 12:02 ` [Bug libstdc++/52562] " redi at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-03-12 11:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

             Bug #: 52562
           Summary: [C++11] Most type_info functions not noexcept
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com


gcc 4.8.0 20120302 (experimental) in C++11 mode rejects the following program:

//------
#include <typeinfo>

template<class T> T& lval() noexcept;

static_assert(noexcept(lval<std::type_info>().name()), "");
static_assert(noexcept(lval<std::type_info>().before(lval<std::type_info>())),
"");
static_assert(noexcept(lval<std::type_info>() == lval<std::type_info>()), "");
static_assert(noexcept(lval<std::type_info>() != lval<std::type_info>()), "");
//------

All four static assertions fail, because the corresponding member functions are
not declared as noexcept contrary to the library specification in 18.7.1
[type.info].


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
@ 2012-03-12 12:02 ` redi at gcc dot gnu.org
  2012-03-12 12:54 ` paolo.carlini at oracle dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2012-03-12 12:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-03-12
     Ever Confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-12 12:02:01 UTC ---
Oops, good catch.


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
  2012-03-12 12:02 ` [Bug libstdc++/52562] " redi at gcc dot gnu.org
@ 2012-03-12 12:54 ` paolo.carlini at oracle dot com
  2012-03-12 13:16 ` paolo.carlini at oracle dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-12 12:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-12 12:54:26 UTC ---
Let's do this now, yes, seems straightforward.


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
  2012-03-12 12:02 ` [Bug libstdc++/52562] " redi at gcc dot gnu.org
  2012-03-12 12:54 ` paolo.carlini at oracle dot com
@ 2012-03-12 13:16 ` paolo.carlini at oracle dot com
  2012-03-12 13:44 ` paolo.carlini at oracle dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-12 13:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.1


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (2 preceding siblings ...)
  2012-03-12 13:16 ` paolo.carlini at oracle dot com
@ 2012-03-12 13:44 ` paolo.carlini at oracle dot com
  2012-03-12 13:50 ` paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-12 13:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-12 13:43:35 UTC ---
Do I understand correctly that in N3291 the destructor lost the explicit
noexcept simply because of core/1123? In that case I think that in GCC we
should mark it temporarily noexcept and then remove it in mainline when
c++/50043 will be addressed (I mean to work on it over the next weeks).
4_7-branch will not change anymore.


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (3 preceding siblings ...)
  2012-03-12 13:44 ` paolo.carlini at oracle dot com
@ 2012-03-12 13:50 ` paolo.carlini at oracle dot com
  2012-03-12 14:07 ` daniel.kruegler at googlemail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-12 13:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-12 13:50:05 UTC ---
Uhm, too much has to be tweaked elsewhere if the destructor is marked noexcept.
Let's leave it alone for now (c++/50043 will reconsider the issue).


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (4 preceding siblings ...)
  2012-03-12 13:50 ` paolo.carlini at oracle dot com
@ 2012-03-12 14:07 ` daniel.kruegler at googlemail dot com
  2012-03-12 15:03 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-03-12 14:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-03-12 14:06:51 UTC ---
(In reply to comment #3)
> Do I understand correctly that in N3291 the destructor lost the explicit
> noexcept simply because of core/1123? 

I don't know for the reason in the stdlib++ change, but the library removed all
explicit throw()/noexcept() specifications on destructors replacing it by the
single general rule of [res.on.exception.handling] p4:

"Every destructor in the C++ standard library shall behave as if it had a
non-throwing exception specification."

which was introduced during noexcept-ification.


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (5 preceding siblings ...)
  2012-03-12 14:07 ` daniel.kruegler at googlemail dot com
@ 2012-03-12 15:03 ` paolo.carlini at oracle dot com
  2012-03-12 15:13 ` paolo at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-12 15:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-12 15:02:51 UTC ---
To clarify, nothing ever changed in libstdc++ as far as the type_info
destructor is concerned. That said, I'm not sure to fully understand why we
have the as-if in p4, or, in other terms, what it does add *beyond* core/1123.


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (6 preceding siblings ...)
  2012-03-12 15:03 ` paolo.carlini at oracle dot com
@ 2012-03-12 15:13 ` paolo at gcc dot gnu.org
  2012-03-12 15:47 ` daniel.kruegler at googlemail dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-03-12 15:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

--- Comment #7 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-03-12 15:12:47 UTC ---
Author: paolo
Date: Mon Mar 12 15:12:40 2012
New Revision: 185235

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185235
Log:
2012-03-12  Paolo Carlini  <paolo.carlini@oracle.com>

    PR libstdc++/52562
    * libsupc++/typeinfo (type_info::name, before, operator==,
    operator!=): Mark noexcept in C++11 mode.
    * libsupc++/tinfo.cc (type_info::operator==): Adjust.
    * libsupc++/tinfo2.cc (type_info::before): Likewise.
    * testsuite/18_support/type_info/52562.cc: New.


Added:
    trunk/libstdc++-v3/testsuite/18_support/type_info/52562.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/libsupc++/tinfo.cc
    trunk/libstdc++-v3/libsupc++/tinfo2.cc
    trunk/libstdc++-v3/libsupc++/typeinfo


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (7 preceding siblings ...)
  2012-03-12 15:13 ` paolo at gcc dot gnu.org
@ 2012-03-12 15:47 ` daniel.kruegler at googlemail dot com
  2012-03-12 16:09 ` paolo.carlini at oracle dot com
  2012-04-22  8:04 ` paolo.carlini at oracle dot com
  10 siblings, 0 replies; 12+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-03-12 15:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

--- Comment #8 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-03-12 15:46:42 UTC ---
(In reply to comment #6)
There exists a compiler problem with noexcept and non-trivial destructor
declarations as described in bug 50043 and in bug 51295. This fix should
automagically ensure that std::type_infos destructor get's an assumed
noexcept(true) exception specification.

The additional library wording exists to ensure that independent of any implied
destructor exception specification of base classes or members of library
internals all destructors of library types needs to behave as noexcept. But
given the current definition of std::type_info there is no reason why an
explicit noexcept(true) specification should be required.


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (8 preceding siblings ...)
  2012-03-12 15:47 ` daniel.kruegler at googlemail dot com
@ 2012-03-12 16:09 ` paolo.carlini at oracle dot com
  2012-04-22  8:04 ` paolo.carlini at oracle dot com
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-12 16:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-12 16:09:25 UTC ---
Ok, ok, so everything boils down to 50043, as I thought.


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

* [Bug libstdc++/52562] [C++11] Most type_info functions not noexcept
  2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
                   ` (9 preceding siblings ...)
  2012-03-12 16:09 ` paolo.carlini at oracle dot com
@ 2012-04-22  8:04 ` paolo.carlini at oracle dot com
  10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-04-22  8:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.7.1                       |4.8.0

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-22 08:04:33 UTC ---
Fixed.


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

end of thread, other threads:[~2012-04-22  8:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-12 11:57 [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept daniel.kruegler at googlemail dot com
2012-03-12 12:02 ` [Bug libstdc++/52562] " redi at gcc dot gnu.org
2012-03-12 12:54 ` paolo.carlini at oracle dot com
2012-03-12 13:16 ` paolo.carlini at oracle dot com
2012-03-12 13:44 ` paolo.carlini at oracle dot com
2012-03-12 13:50 ` paolo.carlini at oracle dot com
2012-03-12 14:07 ` daniel.kruegler at googlemail dot com
2012-03-12 15:03 ` paolo.carlini at oracle dot com
2012-03-12 15:13 ` paolo at gcc dot gnu.org
2012-03-12 15:47 ` daniel.kruegler at googlemail dot com
2012-03-12 16:09 ` paolo.carlini at oracle dot com
2012-04-22  8:04 ` paolo.carlini at oracle dot com

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