mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 18:46:17 +08:00
PR c++/42983, core issue 906
PR c++/42983, core issue 906 * method.c (defaultable_fn_check): Check virtualness. * include/std/thread (~_Impl_base): Move default out of line. * libsupc++/nested_exception.h (~nested_exception): Likewise. From-SVN: r156672
This commit is contained in:
parent
7a79ff3be3
commit
f1c3cf3c93
@ -1,3 +1,8 @@
|
||||
2010-02-10 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/42983, core issue 906
|
||||
* method.c (defaultable_fn_check): Check virtualness.
|
||||
|
||||
2010-02-10 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/43016
|
||||
|
@ -1069,6 +1069,9 @@ defaultable_fn_check (tree fn)
|
||||
if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
|
||||
error ("function %q+D defaulted on its first declaration "
|
||||
"must not have an exception-specification", fn);
|
||||
if (DECL_VIRTUAL_P (fn))
|
||||
error ("%qD declared virtual cannot be defaulted in the class "
|
||||
"body", fn);
|
||||
}
|
||||
else if (!processing_template_decl)
|
||||
defaulted_late_check (fn);
|
||||
|
@ -1,5 +1,9 @@
|
||||
2010-02-10 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/42983, core issue 906
|
||||
* g++.dg/cpp0x/defaulted15.C: Add virtualness test.
|
||||
* g++.dg/cpp0x/defaulted9.C: Move virtual default outside class.
|
||||
|
||||
PR c++/43016
|
||||
* g++.dg/cpp0x/lambda/lambda-conv.C: Test for weakness.
|
||||
|
||||
|
@ -41,3 +41,8 @@ struct G: public F
|
||||
// Can't be const because F copy ctor isn't.
|
||||
G(const G&) = default; // { dg-error "const" }
|
||||
};
|
||||
|
||||
struct H
|
||||
{
|
||||
virtual ~H() = default; // { dg-error "declared virtual" }
|
||||
};
|
||||
|
@ -4,9 +4,11 @@
|
||||
struct _Impl_base
|
||||
{
|
||||
_Impl_base() = default;
|
||||
virtual ~_Impl_base() = default;
|
||||
virtual ~_Impl_base();
|
||||
};
|
||||
|
||||
inline _Impl_base::~_Impl_base() = default;
|
||||
|
||||
template<typename _Tp>
|
||||
class _Impl : public _Impl_base
|
||||
{ };
|
||||
|
@ -1,3 +1,11 @@
|
||||
2010-02-10 Jason Merrill <jason@redhat.com>
|
||||
|
||||
Core issue 906
|
||||
* include/std/thread (~_Impl_base): Move defaulted dtor out of line.
|
||||
* libsupc++/nested_exception.h (~nested_exception): Likewise.
|
||||
* testsuite/18_support/nested_exception/throw_with_nested.cc: Likewise.
|
||||
* testsuite/18_support/nested_exception/rethrow_if_nested.cc: Likewise.
|
||||
|
||||
2010-02-10 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/tr1/hashtable.h: Fold in include/tr1_impl/hashtable.h
|
||||
|
@ -97,7 +97,7 @@ namespace std
|
||||
{
|
||||
__shared_base_type _M_this_ptr;
|
||||
|
||||
virtual ~_Impl_base() = default;
|
||||
virtual ~_Impl_base();
|
||||
|
||||
virtual void _M_run() = 0;
|
||||
};
|
||||
@ -193,6 +193,8 @@ namespace std
|
||||
}
|
||||
};
|
||||
|
||||
inline thread::_Impl_base::~_Impl_base() = default;
|
||||
|
||||
inline void
|
||||
swap(thread& __x, thread& __y)
|
||||
{ __x.swap(__y); }
|
||||
|
@ -63,7 +63,7 @@ namespace std
|
||||
|
||||
nested_exception& operator=(const nested_exception&) = default;
|
||||
|
||||
virtual ~nested_exception() = default;
|
||||
virtual ~nested_exception();
|
||||
|
||||
void
|
||||
rethrow_nested() const __attribute__ ((__noreturn__))
|
||||
@ -74,6 +74,8 @@ namespace std
|
||||
{ return _M_ptr; }
|
||||
};
|
||||
|
||||
inline nested_exception::~nested_exception() = default;
|
||||
|
||||
template<typename _Except>
|
||||
struct _Nested_exception : public _Except, public nested_exception
|
||||
{
|
||||
|
@ -23,7 +23,8 @@
|
||||
|
||||
struct derived : std::nested_exception { };
|
||||
|
||||
struct base { virtual ~base() = default; };
|
||||
struct base { virtual ~base(); };
|
||||
inline base::~base() = default;
|
||||
|
||||
struct derived2 : base, std::nested_exception { };
|
||||
|
||||
|
@ -23,7 +23,8 @@
|
||||
|
||||
struct derived : std::nested_exception { };
|
||||
|
||||
struct not_derived { virtual ~not_derived() = default; };
|
||||
struct not_derived { virtual ~not_derived(); };
|
||||
inline not_derived::~not_derived() = default;
|
||||
|
||||
void test01()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user