Mir

lp:mir FTBFS: surface_info.h:52:13: error: looser throw specifier for ‘virtual mir::input::SurfaceInfoController::~SurfaceInfoController()’

Bug #1199210 reported by Daniel van Vugt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Medium
Daniel van Vugt
gcc
Fix Released
Medium
gcc-defaults (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Raring by Daniel van Vugt

Bug Description

Another gcc 4.7/raring build failure. This one seems to have come from r826...

In file included from /home/dan/bzr/mir/ftb/include/server/mir/input/surface_data_storage.h:22:0,
                 from /home/dan/bzr/mir/ftb/src/server/input/surface_data_storage.cpp:19:
/home/dan/bzr/mir/ftb/include/server/mir/input/surface_info.h:52:13: error: looser throw specifier for ‘virtual mir::input::SurfaceInfoController::~SurfaceInfoController()’
/home/dan/bzr/mir/ftb/include/server/mir/input/surface_info.h:39:13: error: overriding ‘virtual mir::input::SurfaceInfo::~SurfaceInfo() noexcept (true)’
In file included from /home/dan/bzr/mir/ftb/src/server/input/surface_data_storage.cpp:20:0:
/home/dan/bzr/mir/ftb/include/server/mir/surfaces/surface_info.h:53:13: error: looser throw specifier for ‘virtual mir::surfaces::SurfaceInfoController::~SurfaceInfoController()’
/home/dan/bzr/mir/ftb/include/server/mir/surfaces/surface_info.h:41:13: error: overriding ‘virtual mir::surfaces::SurfaceInfo::~SurfaceInfo() noexcept (true)’
make[2]: *** [src/server/input/CMakeFiles/mirinput.dir/surface_data_storage.cpp.o] Error 1
make[1]: *** [src/server/input/CMakeFiles/mirinput.dir/all] Error 2
make: *** [all] Error 2

Related branches

Revision history for this message
In , Paolo-carlini (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.

Revision history for this message
In , Mimomorin (mimomorin) wrote :

Created attachment 26711
A testcase for N3204

Attached a testcase for N3204 ;)

Revision history for this message
In , Redi (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.

Revision history for this message
In , Mimomorin (mimomorin) wrote :

Created attachment 26721
A updated testcase

OK, here is a take two!

Revision history for this message
In , Paolo-carlini (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...

Revision history for this message
In , Paolo-carlini (paolo-carlini) wrote :

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

Revision history for this message
In , Paolo-carlini (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
     {

Revision history for this message
In , Paolo-carlini (paolo-carlini) wrote :

This doesn't compile, for example:

struct B
{
  ~B();
};

B::~B() { }

Revision history for this message
In , Paolo-carlini (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);

Revision history for this message
In , Paolo-k (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 <email address hidden>

 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 <email address hidden>

 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

Revision history for this message
In , Paolo-carlini (paolo-carlini) wrote :

Done. Library clean-ups will follow.

Revision history for this message
In , Paolo-carlini (paolo-carlini) wrote :

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

Revision history for this message
In , Redi (redi) wrote :

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

Revision history for this message
In , Kirbyzhou (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 <email address hidden>
>
> 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 <email address hidden>
>
> 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

Revision history for this message
In , Kirbyzhou (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 <email address hidden>
> >
> > 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 <email address hidden>
> >
> > 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

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, these errors are getting annoying and they're wrong too. GCC has been fixed in 4.8, but the bug remains in GCC 4.7 (raring).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Although a better description is in duplicate bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53613

Changed in gcc-defaults (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
Changed in gcc:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision 831, scheduled for release in mir, milestone 0.0.7

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
milestone: none → 0.0.7
Changed in mir:
status: Fix Committed → Fix Released
Revision history for this message
In , Redi (redi) wrote :

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.