public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
@ 2011-05-18 15:35 ` paolo.carlini at oracle dot com
  2011-05-18 18:23 ` jason at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-18 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-18 15:18:13 UTC ---
Asking Jason' help


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

* [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept
@ 2011-05-18 15:58 paolo.carlini at oracle dot com
  2011-05-18 15:35 ` [Bug c++/49045] " paolo.carlini at oracle dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-18 15:58 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [C++0x] unexpected "different exception specifier"
                    error with noexcept
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: paolo.carlini@oracle.com


Hi. I'm seeing an error for this snippet which I cannot understand:

template<typename _Tp> 
  void 
  swap(_Tp&, _Tp&);

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(swap(*__a, *__b)));

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(swap(*__a, *__b)))
  { }


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
  2011-05-18 15:35 ` [Bug c++/49045] " paolo.carlini at oracle dot com
@ 2011-05-18 18:23 ` jason at gcc dot gnu.org
  2011-05-18 18:25 ` paolo.carlini at oracle dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-18 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-18 18:03:17 UTC ---
Hmm, that's tricky.  G++ is saying that the two exception-specifications are
different because the unqualified lookups for swap differ, because the latter
one also finds the middle declaration.  This seems like a core issue.


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
  2011-05-18 15:35 ` [Bug c++/49045] " paolo.carlini at oracle dot com
  2011-05-18 18:23 ` jason at gcc dot gnu.org
@ 2011-05-18 18:25 ` paolo.carlini at oracle dot com
  2011-05-18 18:42 ` jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-18 18:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-18 18:12:46 UTC ---
Eh, interesting indeed.

By the way, can you imagine a possible workaround for implementing in the
library the swap overload for arrays while also declaring it?


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (2 preceding siblings ...)
  2011-05-18 18:25 ` paolo.carlini at oracle dot com
@ 2011-05-18 18:42 ` jason at gcc dot gnu.org
  2011-05-18 18:47 ` jason at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-18 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-18 18:21:39 UTC ---
A workaround would be to use a forwarding function:

template<typename _Tp>
  void
  swap(_Tp&, _Tp&);

template<class T>
void __do_swap(T&& a,T&& b) { swap(a,b); }

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(__do_swap(*__a, *__b)));

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(__do_swap(*__a, *__b)))
  { }


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (3 preceding siblings ...)
  2011-05-18 18:42 ` jason at gcc dot gnu.org
@ 2011-05-18 18:47 ` jason at gcc dot gnu.org
  2011-05-18 18:52 ` daniel.kruegler at googlemail dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-18 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-18 18:24:31 UTC ---
Or, rather:

template<typename _Tp>
  void
  swap(_Tp&, _Tp&);

template<class T> void __swap_dummy(T&& a,T&& b)
  noexcept(noexcept(swap(a,b)));

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(__swap_dummy(*__a, *__b)));

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(__swap_dummy(*__a, *__b)))
{ swap(*__a,*__b); }

-----

__swap_dummy doesn't actually need a body, but it does need a
noexcept-specifier.


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (4 preceding siblings ...)
  2011-05-18 18:47 ` jason at gcc dot gnu.org
@ 2011-05-18 18:52 ` daniel.kruegler at googlemail dot com
  2011-05-18 19:55 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-05-18 18:52 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-05-18 18:35:09 UTC ---
(In reply to comment #3)

I found a similar approach to Jason based on a helper trait:

template<typename _Tp>
  void
  swap(_Tp&, _Tp&);

template<typename _Tp>
struct __is_nothrow_swappable {
  static const bool value = noexcept(swap(std::declval<_Tp&>(),
std::declval<_Tp&>()));
};

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(__is_nothrow_swappable<_Tp>::value);

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(__is_nothrow_swappable<_Tp>::value)
  { }


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (5 preceding siblings ...)
  2011-05-18 18:52 ` daniel.kruegler at googlemail dot com
@ 2011-05-18 19:55 ` paolo.carlini at oracle dot com
  2011-05-20 23:05 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-18 19:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-18 18:40:35 UTC ---
Ok guys. Thanks a lot for the suggestions, indeed should figured out both
myself, eh! ;)


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (6 preceding siblings ...)
  2011-05-18 19:55 ` paolo.carlini at oracle dot com
@ 2011-05-20 23:05 ` jason at gcc dot gnu.org
  2011-08-23 15:54 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-20 23:05 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2011.05.20 22:07:43
     Ever Confirmed|0                           |1

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-20 22:07:43 UTC ---
Suspending for core resolution.


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (7 preceding siblings ...)
  2011-05-20 23:05 ` jason at gcc dot gnu.org
@ 2011-08-23 15:54 ` jason at gcc dot gnu.org
  2011-08-23 16:32 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-23 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.7.0


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (8 preceding siblings ...)
  2011-08-23 15:54 ` jason at gcc dot gnu.org
@ 2011-08-23 16:32 ` jason at gcc dot gnu.org
  2011-08-23 16:42 ` paolo.carlini at oracle dot com
  2011-08-25  6:51 ` jason at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-23 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2011-08-23 16:03:56 UTC ---
Author: jason
Date: Tue Aug 23 16:03:44 2011
New Revision: 177998

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177998
Log:
    PR c++/49045
    Core 1321
    * tree.c (dependent_name): New.
    (cp_tree_equal): Two calls with the same dependent name are
    equivalent even if the overload sets are different.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/overload2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (9 preceding siblings ...)
  2011-08-23 16:32 ` jason at gcc dot gnu.org
@ 2011-08-23 16:42 ` paolo.carlini at oracle dot com
  2011-08-25  6:51 ` jason at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-23 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-23 16:40:01 UTC ---
Great. I'll soon remove the wa and adjust the library.


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

* [Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
  2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
                   ` (10 preceding siblings ...)
  2011-08-23 16:42 ` paolo.carlini at oracle dot com
@ 2011-08-25  6:51 ` jason at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2011-08-25  6:51 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> 2011-08-25 05:08:46 UTC ---
Fixed as per core decision in Bloomington.


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

end of thread, other threads:[~2011-08-25  5:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 15:58 [Bug c++/49045] New: [C++0x] unexpected "different exception specifier" error with noexcept paolo.carlini at oracle dot com
2011-05-18 15:35 ` [Bug c++/49045] " paolo.carlini at oracle dot com
2011-05-18 18:23 ` jason at gcc dot gnu.org
2011-05-18 18:25 ` paolo.carlini at oracle dot com
2011-05-18 18:42 ` jason at gcc dot gnu.org
2011-05-18 18:47 ` jason at gcc dot gnu.org
2011-05-18 18:52 ` daniel.kruegler at googlemail dot com
2011-05-18 19:55 ` paolo.carlini at oracle dot com
2011-05-20 23:05 ` jason at gcc dot gnu.org
2011-08-23 15:54 ` jason at gcc dot gnu.org
2011-08-23 16:32 ` jason at gcc dot gnu.org
2011-08-23 16:42 ` paolo.carlini at oracle dot com
2011-08-25  6:51 ` jason at gcc dot gnu.org

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