[Bug 1201246] Re: lp:mir FTBFS: error: looser throw specifier for ‘testing::NiceMock<M>::~NiceMock()

Bug Watch Updater 1201246 at bugs.launchpad.net
Mon Jul 15 03:57:25 UTC 2013


Launchpad has imported 15 comments from the remote bug at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50043.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2011-08-11T09:23:21+00:00 Paolo-carlini wrote:

... let's try this new Bugzilla ;)

This is an internal reminder that it would be nice to have implemented
quite soon the resolution of core/1123:

  http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1123

For sure the library would immediately benefit, no more explicitly
noexcept destructors in a lot of places.

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/0

------------------------------------------------------------------------
On 2012-02-21T11:51:14+00:00 Mimomorin wrote:

Created attachment 26711
A testcase for N3204

Attached a testcase for N3204 ;)

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/1

------------------------------------------------------------------------
On 2012-02-21T12:05:40+00:00 Redi wrote:

We don't want front-end testcases that rely on <iostream> and need to
check what gets printed. A better test would use static_assert, but
would also test cases with both throwing and non-throwing base class and
members.

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/2

------------------------------------------------------------------------
On 2012-02-22T02:43:30+00:00 Mimomorin wrote:

Created attachment 26721
A updated testcase

OK, here is a take two!

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/3

------------------------------------------------------------------------
On 2012-03-23T01:05:26+00:00 Paolo-carlini wrote:

Jason, I'm glad to work on this (if you don't have anything better to do
;) Any tips for me? Shouldn't be so hard but I'm still a bit lost...

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/4

------------------------------------------------------------------------
On 2012-03-23T01:07:00+00:00 Paolo-carlini wrote:

Of course I meant "if you have something better to do ;)"

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/5

------------------------------------------------------------------------
On 2012-03-23T17:59:05+00:00 Paolo-carlini wrote:

I'm making some progress understanding these parts of the front-end.

For example the following trivial patchlet passes the testcase ;) But,
seriously, I'm not sure whether we really need a full fledged
build_exception_variant, whether we have to do something about LAZY_*
things, and much, much, more.


Index: class.c
===================================================================
--- class.c     (revision 185722)
+++ class.c     (working copy)
@@ -1001,6 +1001,10 @@ add_method (tree type, tree method, tree using_dec
                   "destructor",
                   type);
        }
+      else if (cxx_dialect >= cxx0x
+              && !TYPE_RAISES_EXCEPTIONS (TREE_TYPE (method)))
+       TREE_TYPE (method) = build_exception_variant (TREE_TYPE (method),
+                                                     noexcept_true_spec);
     }
   else
     {

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/6

------------------------------------------------------------------------
On 2012-03-23T18:17:56+00:00 Paolo-carlini wrote:

This doesn't compile, for example:

struct B
{
  ~B();
};

B::~B() { }

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/7

------------------------------------------------------------------------
On 2012-03-23T22:48:59+00:00 Paolo-carlini wrote:

The latter issue could be addressed by something like:

Index: decl.c
===================================================================
--- decl.c	(revision 185715)
+++ decl.c	(working copy)
@@ -1136,7 +1136,10 @@ check_redeclaration_exception_specification (tree
   if ((pedantic || ! DECL_IN_SYSTEM_HEADER (old_decl))
       && ! DECL_IS_BUILTIN (old_decl)
       && flag_exceptions
-      && !comp_except_specs (new_exceptions, old_exceptions, ce_normal))
+      && !comp_except_specs (new_exceptions, old_exceptions, ce_normal)
+      && !(DECL_DESTRUCTOR_P (new_decl)
+	   && cxx_dialect >= cxx0x
+	   && !new_exceptions && TYPE_NOEXCEPT_P (old_type)))	
     {
       error ("declaration of %qF has a different exception specifier",
 	     new_decl);

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/8

------------------------------------------------------------------------
On 2012-04-02T00:13:35+00:00 Paolo-k wrote:

Author: paolo
Date: Mon Apr  2 00:13:30 2012
New Revision: 186058

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186058
Log:
/cp
2012-04-01  Paolo Carlini  <paolo.carlini at oracle.com>

	PR c++/50043
	* class.c (deduce_noexcept_on_destructor,
	deduce_noexcept_on_destructors): New.
	(check_bases_and_members): Call the latter.
	* decl.c (grokfndecl): Call the former.
	* method.c (implicitly_declare_fn): Not static.
	* cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
	Declare

/testsuite
2012-04-01  Paolo Carlini  <paolo.carlini at oracle.com>

	PR c++/50043
	* g++.dg/cpp0x/noexcept17.C: New.
	* g++.old-deja/g++.eh/cleanup1.C: Adjust.
	* g++.dg/tree-ssa/ehcleanup-1.C: Likewise.
	* g++.dg/cpp0x/noexcept01.C: Likewise.
	* g++.dg/eh/init-temp1.C: Likewise.
	* g++.dg/eh/ctor1.C: Likwise.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/noexcept17.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/method.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/noexcept01.C
    trunk/gcc/testsuite/g++.dg/eh/ctor1.C
    trunk/gcc/testsuite/g++.dg/eh/init-temp1.C
    trunk/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
    trunk/gcc/testsuite/g++.old-deja/g++.eh/cleanup1.C

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/9

------------------------------------------------------------------------
On 2012-04-02T00:19:43+00:00 Paolo-carlini wrote:

Done. Library clean-ups will follow.

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/10

------------------------------------------------------------------------
On 2012-04-12T00:10:26+00:00 Paolo-carlini wrote:

*** Bug 51295 has been marked as a duplicate of this bug. ***

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/11

------------------------------------------------------------------------
On 2012-06-11T10:28:40+00:00 Redi wrote:

*** Bug 53613 has been marked as a duplicate of this bug. ***

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/12

------------------------------------------------------------------------
On 2012-06-13T03:48:34+00:00 Kirbyzhou wrote:

How about back port this patch to 4.7 branch?
It cause a lot of compile error which easily confuse programmers.


(In reply to comment #9)
> Author: paolo
> Date: Mon Apr  2 00:13:30 2012
> New Revision: 186058
> 
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186058
> Log:
> /cp
> 2012-04-01  Paolo Carlini  <paolo.carlini at oracle.com>
> 
>     PR c++/50043
>     * class.c (deduce_noexcept_on_destructor,
>     deduce_noexcept_on_destructors): New.
>     (check_bases_and_members): Call the latter.
>     * decl.c (grokfndecl): Call the former.
>     * method.c (implicitly_declare_fn): Not static.
>     * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
>     Declare
> 
> /testsuite
> 2012-04-01  Paolo Carlini  <paolo.carlini at oracle.com>
> 
>     PR c++/50043
>     * g++.dg/cpp0x/noexcept17.C: New.
>     * g++.old-deja/g++.eh/cleanup1.C: Adjust.
>     * g++.dg/tree-ssa/ehcleanup-1.C: Likewise.
>     * g++.dg/cpp0x/noexcept01.C: Likewise.
>     * g++.dg/eh/init-temp1.C: Likewise.
>     * g++.dg/eh/ctor1.C: Likwise.
> 
> Added:
>     trunk/gcc/testsuite/g++.dg/cpp0x/noexcept17.C
> Modified:
>     trunk/gcc/cp/ChangeLog
>     trunk/gcc/cp/class.c
>     trunk/gcc/cp/cp-tree.h
>     trunk/gcc/cp/decl.c
>     trunk/gcc/cp/method.c
>     trunk/gcc/testsuite/ChangeLog
>     trunk/gcc/testsuite/g++.dg/cpp0x/noexcept01.C
>     trunk/gcc/testsuite/g++.dg/eh/ctor1.C
>     trunk/gcc/testsuite/g++.dg/eh/init-temp1.C
>     trunk/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
>     trunk/gcc/testsuite/g++.old-deja/g++.eh/cleanup1.C

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/13

------------------------------------------------------------------------
On 2012-06-15T02:14:48+00:00 Kirbyzhou wrote:

I have tested to apply this patch to 4.7 branch, everythings goes well.
Since it breaks already existing code, anybody can do commit backport to 4.7 branch?

(In reply to comment #13)
> How about back port this patch to 4.7 branch?
> It cause a lot of compile error which easily confuse programmers.
> (In reply to comment #9)
> > Author: paolo
> > Date: Mon Apr  2 00:13:30 2012
> > New Revision: 186058
> > 
> > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186058
> > Log:
> > /cp
> > 2012-04-01  Paolo Carlini  <paolo.carlini at oracle.com>
> > 
> >     PR c++/50043
> >     * class.c (deduce_noexcept_on_destructor,
> >     deduce_noexcept_on_destructors): New.
> >     (check_bases_and_members): Call the latter.
> >     * decl.c (grokfndecl): Call the former.
> >     * method.c (implicitly_declare_fn): Not static.
> >     * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
> >     Declare
> > 
> > /testsuite
> > 2012-04-01  Paolo Carlini  <paolo.carlini at oracle.com>
> > 
> >     PR c++/50043
> >     * g++.dg/cpp0x/noexcept17.C: New.
> >     * g++.old-deja/g++.eh/cleanup1.C: Adjust.
> >     * g++.dg/tree-ssa/ehcleanup-1.C: Likewise.
> >     * g++.dg/cpp0x/noexcept01.C: Likewise.
> >     * g++.dg/eh/init-temp1.C: Likewise.
> >     * g++.dg/eh/ctor1.C: Likwise.
> > 
> > Added:
> >     trunk/gcc/testsuite/g++.dg/cpp0x/noexcept17.C
> > Modified:
> >     trunk/gcc/cp/ChangeLog
> >     trunk/gcc/cp/class.c
> >     trunk/gcc/cp/cp-tree.h
> >     trunk/gcc/cp/decl.c
> >     trunk/gcc/cp/method.c
> >     trunk/gcc/testsuite/ChangeLog
> >     trunk/gcc/testsuite/g++.dg/cpp0x/noexcept01.C
> >     trunk/gcc/testsuite/g++.dg/eh/ctor1.C
> >     trunk/gcc/testsuite/g++.dg/eh/init-temp1.C
> >     trunk/gcc/testsuite/g++.dg/tree-ssa/ehcleanup-1.C
> >     trunk/gcc/testsuite/g++.old-deja/g++.eh/cleanup1.C

Reply at: https://bugs.launchpad.net/mir/+bug/1201246/comments/14


** Changed in: gcc
       Status: Unknown => Fix Released

** Changed in: gcc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1201246

Title:
  lp:mir FTBFS: error: looser throw specifier for
  ‘testing::NiceMock<M>::~NiceMock()

Status in The GNU Compiler Collection:
  Fix Released
Status in Mir:
  New
Status in “gcc-defaults” package in Ubuntu:
  Fix Released

Bug description:
  I know this is a gcc-4.7 (raring) bug. But I'm logging it in case we
  can find a workaround.

  [ 48%] Building CXX object tests/mir_test_doubles/CMakeFiles/mir-test-doubles.dir/test_protobuf_client.cpp.o
  In file included from /usr/include/gmock/gmock.h:62:0,
                   from /home/dan/bzr/mir/ftb/include/test/mir_test/test_protobuf_client.h:25,
                   from /home/dan/bzr/mir/ftb/tests/mir_test_doubles/test_protobuf_client.cpp:19:
  /usr/include/gmock/gmock-generated-nice-strict.h: In instantiation of ‘class testing::NiceMock<mir::test::doubles::MockRpcReport>’:
  /usr/include/c++/4.7/type_traits:1252:2:   required by substitution of ‘template<class _From1, class _To1> static decltype ((__test_aux<_To1>(declval<_From1>()), std::__sfinae_types::__one())) std::__is_convertible_helper<_From, _To, false>::__test(int) [with _From1 = _From1; _To1 = _To1; _From = testing::NiceMock<mir::test::doubles::MockRpcReport>*; _To = mir::test::doubles::MockRpcReport*] [with _From1 = testing::NiceMock<mir::test::doubles::MockRpcReport>*; _To1 = mir::test::doubles::MockRpcReport*]’
  /usr/include/c++/4.7/type_traits:1258:70:   required from ‘constexpr const bool std::__is_convertible_helper<testing::NiceMock<mir::test::doubles::MockRpcReport>*, mir::test::doubles::MockRpcReport*, false>::value’
  /usr/include/c++/4.7/type_traits:1263:12:   required from ‘struct std::is_convertible<testing::NiceMock<mir::test::doubles::MockRpcReport>*, mir::test::doubles::MockRpcReport*>’
  /usr/include/c++/4.7/bits/shared_ptr.h:216:31:   required from here
  /usr/include/gmock/gmock-generated-nice-strict.h:166:11: error: looser throw specifier for ‘testing::NiceMock<M>::~NiceMock() [with MockClass = mir::test::doubles::MockRpcReport]’
  In file included from /home/dan/bzr/mir/ftb/tests/mir_test_doubles/test_protobuf_client.cpp:20:0:
  /home/dan/bzr/mir/ftb/include/test/mir_test_doubles/mock_rpc_report.h:38:5: error:   overriding ‘virtual mir::test::doubles::MockRpcReport::~MockRpcReport() noexcept (true)’
  make[2]: *** [tests/mir_test_doubles/CMakeFiles/mir-test-doubles.dir/test_protobuf_client.cpp.o] Error 1
  make[1]: *** [tests/mir_test_doubles/CMakeFiles/mir-test-doubles.dir/all] Error 2
  make: *** [all] Error 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1201246/+subscriptions




More information about the foundations-bugs mailing list