re PR c++/56343 ([C++11] Destructor defaulted on first declaration has wrong implicit exception specification)
PR c++/56343 * class.c (check_bases_and_members): Deduce noexcept after checking bases. From-SVN: r196082
This commit is contained in:
parent
30fa2a51fa
commit
52d95c2127
@ -1,5 +1,9 @@
|
||||
2013-02-15 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/56343
|
||||
* class.c (check_bases_and_members): Deduce noexcept after
|
||||
checking bases.
|
||||
|
||||
PR c++/52026
|
||||
* semantics.c (finish_id_expression): In a template, return
|
||||
the identifier for a constant variable.
|
||||
|
@ -5245,14 +5245,15 @@ check_bases_and_members (tree t)
|
||||
cant_have_const_ctor = 0;
|
||||
no_const_asn_ref = 0;
|
||||
|
||||
/* Deduce noexcept on destructors. */
|
||||
if (cxx_dialect >= cxx0x)
|
||||
deduce_noexcept_on_destructors (t);
|
||||
|
||||
/* Check all the base-classes. */
|
||||
check_bases (t, &cant_have_const_ctor,
|
||||
&no_const_asn_ref);
|
||||
|
||||
/* Deduce noexcept on destructors. This needs to happen after we've set
|
||||
triviality flags appropriately for our bases. */
|
||||
if (cxx_dialect >= cxx0x)
|
||||
deduce_noexcept_on_destructors (t);
|
||||
|
||||
/* Check all the method declarations. */
|
||||
check_methods (t);
|
||||
|
||||
|
14
gcc/testsuite/g++.dg/cpp0x/defaulted41.C
Normal file
14
gcc/testsuite/g++.dg/cpp0x/defaulted41.C
Normal file
@ -0,0 +1,14 @@
|
||||
// PR c++/56343
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
class B
|
||||
{
|
||||
public:
|
||||
virtual ~B() noexcept(false) { }
|
||||
};
|
||||
|
||||
class D : public B
|
||||
{
|
||||
public:
|
||||
virtual ~D() = default;
|
||||
};
|
Loading…
Reference in New Issue
Block a user